wood burning stoves 2.0*
The moose likes JDBC and the fly likes threads-database connection-servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "threads-database connection-servlet" Watch "threads-database connection-servlet" New topic
Author

threads-database connection-servlet

Ann Kanu
Ranch Hand

Joined: Feb 01, 2004
Posts: 30
In my application running on weblogic, I am using the MVC pattern with jsps for creating views, a controller servlet and java classes for business logic. I have a seperate class for establishing database connection / checking out database connection from the connection pool. In the service() method of my controller servlet, I use one of the classes, performing business logic, which in turn uses the Database connection class for performing select/updates on the database tables. This is a portion of my code from the service() method.
if ( functionCode.equalsIgnoreCase("EDIT")) {
School school = new school(req,loginUserId,functionCode);
school.setLoginUserId(loginUserId);
school.saveChanges();
String function = "Edit";
showSuccess(function,req,res);
}
In this scenario, should I be concerned about multithreading issues regarding database connectivity in the class School? If so, what portions of my code would I need to synchronize.
Thanks,
Ann
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: threads-database connection-servlet
 
Similar Threads
Keeping code out of the Servlet
database connectivity - multithread
jspInit() method
How to prompt if there is no match in database using servlet?
querying html/servlet