• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Vasilis Karas
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • 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?
 
Al Tam
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Al, thanks for responding.
We're using MS SQL server.

thanks again.
VK
 
Caitlin Fourie
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic