Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection and Statements in JDBC...

 
gmpatil
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I create multiple statements from a single jdbc Connection and execute them in different threads simultaneously ?.
I am asking this Q bcoz, I am writing a servlet which has a static Connection object which other instances/thread of servlet will use to access oracle DB. Servlet should handle 200-300 users during peak hours.
OR
I should control creating statements out of Connection.
what are advantages and disadvantages with each options.
note: some of the columns of table are of type LONG RAW, and I am reading them via streams.
thanks in advance
[This message has been edited by gmpatil (edited January 31, 2000).]
 
Alex Guo
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can create mutiple statements from one connection.
But from the point of view of data integrity, you'd better synchronize the usage
of connection. Also another important issue is do NOT forget to close your
statements generated by connection. Otherwise each statement will occupy
an open cursor in database and soon your application will fail!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic