Somebody knows so that I receipt this exception? The program is
multi-thread, that makes consultations to the BD (Oracle)
continuously. Thanks.
/////////////////////EXCEPTION/////////////////
java.sql.SQLException: Resultset Agotado
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:211)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:274)
at oracle.jdbc.driver.OracleStatement.prepare_for_new_get(OracleStatement.java:2558)
at oracle.jdbc.driver.OracleStatement.getStringValue(OracleStatement.java:2693)
at oracle.jdbc.driver.OracleResultSetImpl.getString(OracleResultSetImpl.java:307)
at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1374)
at vivamsn.ConectarDB.entsal(ConectarDB.java:274)
at vivamsn.ReceptorMSG.run(ReceptorMSG.java:29)
at java.lang.Thread.run(Thread.java:536)
/////////////////////SOURCE/////////////////
public boolean entsal(String id){
try {
Thread.sleep(1*1000);
}
catch (InterruptedException ex) {
ex.printStackTrace();
//System.out.println("Ojo: "+ex.toString());
}
String queryString = "select ENTSAL from usuario where ID =
'"+id+"'";
String ALIVE="";
try {
ResultSet RSET = statement.executeQuery(queryString);
if (RSET.next()){
ALIVE = RSET.getString("ENTSAL"); //////////////// Line
274//////////
}
RSET.close();
if (ALIVE.equals("1")){
return true;
}else{
return false;
}
}
catch (Exception ex) {
ex.printStackTrace();
//System.out.println("Ojo: "+ex.toString());
return false;
}
}
Thanks to all;
Mikel
Are you sharing 'statement' between the threads? This is not likely to work because a
java.sql.Statement object can only have one active resultset at a time. Try using a
separate Statement for each thread.
--
Lee Fesperman, FirstSQL, Inc. (http://www.firstsql.com)
==============================================================
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)