This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Can statement be used in multi-thread? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Can statement be used in multi-thread?" Watch "Can statement be used in multi-thread?" New topic
Author

Can statement be used in multi-thread?

William Yan
Ranch Hand

Joined: Sep 26, 2006
Posts: 69
Hi ranchers,
I am new to JDBC,
I wonder if the statement can be used in multi-thread. I mean i create a statement object by Connection. And pass the reference to mutli-thread, then mutli-thread uses the statement to executeQuery, can it work? And can preparedStatement work that way?

I know Connection can be used concurrently by many users, but how many is appropriate?

Thank you in advance,
William.


Java is better and better, yet bitter and bitter.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can statement be used in multi-thread?
 
Similar Threads
Question on thread
Can statement be used in multi-thread?
Rock paper scissors project
JVM improvements?
Important?