Open crowmagnumb opened 6 years ago
Any resolution to this, besides switching to statement.execute()?
If it helps, my bug was a matter of accessing a ResultSet on the PreparedStatement vs on the DBConnection object. Not a C3P0 issue.
BAD 2245 | < | while(dbCon.getPrepStmt().getResultSet().next()){ 2246 | < | int count = dbCon.getPrepStmt().getResultSet().getInt("c");
GOOD 2245 | > | while(dbCon.getResultSet().next()){ 2246 | > | int count = dbCon.getResultSet().getInt("c");
Using a c3p0 (v0.9.5.2) connection from a ComboPooledDataSource to perform a simple SQL SELECT statement using postgres I get the following error if I use
statement.executeQuery()
...... but if I use
statement.execute()
it's fine. What is going on there? Here is my code whereconnectionProvider
is aComboPooledDataSource
....After stepping through the ResultSet I perform a
statement.close()
and get ...If, however, sub
statement.execute()
forstatement.executeQuery()
I don't have this problem.