This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Servlets and the fly likes sql helper class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "sql helper class" Watch "sql helper class" New topic
Author

sql helper class

Matt Wielbut
Greenhorn

Joined: Jun 04, 2002
Posts: 3
I've got a class that only contains static methods in the form

that all the servelts use to execute SQL statements.
I use a connection pool that is thread safe to get DB connections but do these methods need to be synchronized also. The rule I've always followed is, if multilple threads are mutating a variable then make the code synchronized. Is this correct?
ib idris
Greenhorn

Joined: Aug 02, 2003
Posts: 29
Hi,
any decent DB has safeguards against data corruption. The JDBC an Servlets desingers have also thought about this kind of problems. But to be safe you sould make backups and turn autocommit off.
http://galileo.spaceports.com/~ibidris/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sql helper class