wood burning stoves*
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()?
 
jQuery in Action, 2nd edition
 
subject: Are PreparedStatments scoped at the Connection level.
 
Similar Threads
how to move data to other table
Insert Date With Time Prepared Stament...?
cannot insert datetime type
Updation problem in JDBC
Are there any problems using the same statement for multiple queries?