wood burning stoves 2.0*
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
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.
 
Similar Threads
Updation problem in JDBC
Insert Date With Time Prepared Stament...?
how to move data to other table
cannot insert datetime type
Are there any problems using the same statement for multiple queries?