Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JDBC and Relational Databases and the fly likes Are PreparedStatments scoped at the Connection level. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Are PreparedStatments scoped at the Connection level." Watch "Are PreparedStatments scoped at the Connection level." New topic
Author

Are PreparedStatments scoped at the Connection level.

CJL023
Greenhorn

Joined: Jun 11, 2002
Posts: 1
If I do the following:
PreparedStatement stmt1 = conn1.prepareStatement("INSERT INTO TABLEX VALUES (?,?,?)";
PreparedStatement stmt2 = conn2.prepareStatement("INSERT INTO TABLEX VALUES (?,?,?)";
and then create two threads where thread 1 uses stmt1 and thread 2 uses stmt2, should I expect this to work?
Or will the threads interfere with one another when calling setXXX() methods and executeUpdate()?
 
Have you checked out Aspose?
 
subject: Are PreparedStatments scoped at the Connection level.
 
It's not a secret anymore!