aspose file tools*
The moose likes JDBC 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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
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()?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Are PreparedStatments scoped at the Connection level.