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

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 love a woman who dresses in stainless steel ... and carries tiny ads:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic