I have a query made to a db and the result is obtained through a java.sql.ResultSet
, because this query is dynamic the number of columns returned could be 5 or 7, in the past with the same code it was generated a “column not found exception” and was contained in the following catch:
try{
sTemp = this.rsResults.getString("col3");
}catch(Exception e){}
But now with the same try and catch (the only difference is that now i’m using combopooldatasource
and their connection), I get two exceptions that do not fall in the catch.
How could I improve this, is there a better way to check if column exists?
Does c3p0 have to mandatory test the connection based on a (SQLState: S0022) column not found error
?
Error n1 - in the com.mchange.v2.c3p0.impl.NewProxyResultSet.getString qlUtils.toSQLException() - Attempted to convert SQLException to SQLException. Leaving it alone. [SQLState: S0022; errorCode: 0]
java.sql.SQLException: Column 'col3' not found.
Error n2 - DefaultConnectionTester.statusOnException() - Testing a Connection in response to an Exception:
java.sql.SQLException: Column 'col3' not found.
ps: the driver used is the same org.gjt.mm.mysql.Driver