This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes database access & request dipatcher Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "database access & request dipatcher " Watch "database access & request dipatcher " New topic
Author

database access & request dipatcher

manish ahuja
Ranch Hand

Joined: Oct 23, 2003
Posts: 312
Hi
1) How to handle multiple concurrent database requests/updates when using JDBC with servlets?
2)When using a dispatcher and calling .forward(), will doGet() or doPost() be called in the target servlet?

Rgrds
manish ahuja
Ranch Hand

Joined: Oct 23, 2003
Posts: 312
Hey guys
Can anyone take a shot at this
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Firstly these are two questions, it would be better to hava separate thread for each.
Database access in a J2EE application should be managed through a DataSource configured in the application server. This allows the server to manage distributed transactions (if the database and drivers support this). It makes database access much easier since you can go (pseudo code only ):

It is important to note that the database code does not have to be in the Servlet (you can delegate the responisility to another class that just returns objects).
I'll have to check on the other, I only ever forward to a JSP, and the _jspService takes care of both. I believe it will be whatever the initial request was ie GET -> forward -> doGet, POST -> forward -> doPost, but I'll have to double check.
Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: database access & request dipatcher
 
Similar Threads
while connecting to database
Designing in Hibernate
Applet
Expert Oracle JDBC Programming - book promotion topic
PreparedStatement problem; Doesn't happen with plain SQL