aspose file tools*
The moose likes JDBC and the fly likes Limit on number of statements exceeded Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Limit on number of statements exceeded" Watch "Limit on number of statements exceeded" New topic
Author

Limit on number of statements exceeded

Daniel Eriksson
Greenhorn

Joined: Oct 25, 2004
Posts: 5
Hi,

I have a problem with the number of open PreparedStatements on a JDBC connection (JTOpen).
java.sql.SQLException: Limit on number of statements exceeded.

The problem comes from a large number of statements being executed on the same connection before it is returned to the pool. I am pretty sure that i close all statements and resultsets after use, but I might have missed it somewhere.

Is it possible to get the number of open statements for a particular Connection ?

So that i can monitor number of open statements at certain points during the execution ...
Maximilian Xavier Stocker
Ranch Hand

Joined: Sep 20, 2005
Posts: 381
Originally posted by B. Daniel Eriksson:
Hi,

I have a problem with the number of open PreparedStatements on a JDBC connection (JTOpen).
java.sql.SQLException: Limit on number of statements exceeded.

The problem comes from a large number of statements being executed on the same connection before it is returned to the pool. I am pretty sure that i close all statements and resultsets after use, but I might have missed it somewhere.

Is it possible to get the number of open statements for a particular Connection ?

So that i can monitor number of open statements at certain points during the execution ...


Not really no. Sounds to me like there are in fact alot of statements at least left lying open. Which probably means it is time to revisit all your code and probably your design in detail to see why this is happening.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Limit on number of statements exceeded