• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is there a limit to # of Statements over a Connection object

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there a limit or performance pitfall I need to be aware of in terms of how many Statement(PreparedStatements) objects I should create over one Connection object? Currently I have a singleton class where my DB calls are made from. When instantiating the class through static method, I pass in a Connection object that creates about ten preparedstatement objects. Is there a limit of how many Preparedstatements I should restrict a Connection to?
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It depends on the database that you are using.

Which DB are you using? Oracle?
 
Vasilis Karas
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Al, thanks for responding.
We're using MS SQL server.

thanks again.
VK
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it true that a connection is limited in the amount of statements it can handle according to type of database?
Surely a connection, as long as it is kept alive and statements are correctly closed, can handle an unlimited amount of PreparedStatement and Statement objects regardless of db type, or how else would pooled connections work efficiently?
I'm interested to know which particular databases do impose limits... maybe I've been using Connection objects incorrectly all along...
 
Vasilis Karas
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure but the way I've built each singleton class with ten or more PreparedStatements over a connection I was growing concerned.
 
I've never won anything before. Not even a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic