Bear with me - I last worked with servlets/jsps in 2003. I recently inherited an application that uses all JSPs with JSTL, no servlet. All SQL is done with the JSTL tags, and we are seeing connection/deadlock errors. After trying to troubleshoot the issue, all signs point to "rewrite the database stuff using beans - don't use JSTL sql tags in production."
My problem is I can't find out how to exactly do that. I know how to use JavaBeans with JSP pages, but I don't know how to use them for database interaction. Based on this website, I ordered the highly recommended book "Head First Servlets & JSP 2nd Edition," and I have to say I'm highly disappointed and frustrated that I spent 40 bucks and waited a week for shipping to find out that it doesn't address the database at all. It even admits most JSP/Servlet applications work with a database, but it does not address how to do so. In fact, it barely mentions using beans at all. (Maybe it's my own fault; I was leery that the title geared it to the exam, but everyone said it was a great resourse book as well. But how an 800 page book on Servlets/JSP does not even cover one simple web app end-to-end is beyond me. Thank you for letting me vent, I'm better now.)
So I've been searching forums and Java sites, but cannot find anything that explains in any amount of detail the best way to update my database with JSP form data. If I had two weeks, I'd convert the application to Grails. But for now, I just need to solve the database errors we are getting in the quickest way possible, while adhering to good Java practices.
The official J2EE tutorial uses Java Persistence API, which looks similar to Hibernate. I have not used either outside of a small Grails app, and we have no long-term plans to create more JSP applications and there are time constraints. So I'll learn it if it's the best way, but want to be sure I'm spending my time wisely.
If anyone can point me to some good resources on using JSP with a database (MySql in this case), I'd be very grateful.