Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can statement be used in multi-thread?

 
William Yan
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!