But ! I can not have stable behaviour with ResultSet :
- Sometimes all records are returned. Fine !!!
- Sometimes, 0 (Zero) record is returned. Too bad !
- Sometimes, some (but not all) records are returned. Bad !
And, When all records are not returned, one of the two following exception types is raised :
java.sql.SQLException: Operation not allowed after ResultSet closed
at com.mysql.jdbc.ResultSet.checkClosed(ResultSet.jav a:3601)
at com.mysql.jdbc.ResultSet.checkRowPos(ResultSet.jav a:3614)
at com.mysql.jdbc.ResultSet.checkRowPos(ResultSet.jav a:3625)
at com.mysql.jdbc.ResultSet.getString(ResultSet.java: 1772)
at org.apache.commons.dbcp.DelegatingResultSet.getStr ing(DelegatingResultSet.java:137)
What my application does :
- Inserting rows in a table (strings, dates, integers).
- And the, selecting table in a Resultset for gettind data
- I use ResultSet.getString() for getting all fields.
Database Pooling configuration in server.xml file :
Do you mean I have to put the code inside the "try" in a loop and let it run until I get a valid Resultset ? Do you know how I could make sure my Resultset is valid. I could test if (t_rs != null) of course. What if t_rs is not null but is valid only for the first records (obtained by t_rs.next()) ?
In my case, It seems that the t_rs is not null, but something wrong happenned when the next is called.