• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Connection and Statements in JDBC...

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic