aspose file tools
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


Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
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()?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Are PreparedStatments scoped at the Connection level.