Exhausted ResultSet
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Adrian_K
Posted On:   Thursday, May 9, 2002 09:08 AM

I get this message (Exhausted ResultSet) when a I try to run a code like this. If I copy&paste the query and execute it under TOAD or Forte in the Runtime Tab (Command Execute) I can get the ResultSet without problems. Another thing I could observe: if I delete the WHERE clause from the query and the setInt and setString in the PreparedStatement I also can get the ResultSet. I am using Oracle thin driver (classes12) in order to connect to an Oracle 8 Database. The program executes under Win95 & Unix. Thx in advance! //... //... String query = "select * from webtables.values@MYLINK where (parameter01=?) & (parameter02=?)"; P   More>>

I get this message (Exhausted ResultSet) when a I try to run a code like this. If I copy&paste the query and execute it under TOAD or Forte in the Runtime Tab (Command Execute) I can get the ResultSet without problems.


Another thing I could observe: if I delete the WHERE clause from the query and the setInt and setString in the PreparedStatement I also can get the ResultSet.


I am using Oracle thin driver (classes12) in order to connect to an Oracle 8 Database.
The program executes under Win95 & Unix.


Thx in advance!


			
//...
//...

String query = "select * from webtables.values@MYLINK where (parameter01=?) & (parameter02=?)";
PreparedStatement myStatement = connection.createStatement(query);

//...
//...

public void printValues (int param01, int param02){
try{
int i = 1;
synchronized(myStatement){
myStatement.clearParameters();
myStatement.setInt(i++, param01);
myStatement.setString(i++, param02);

results = myStatement.executeQuery();

if(results.next()){
System.out.println("Values:" + results.getString("VAL01") + ", " + results.getString("VAL02"));
}

}catch(SQLException e){
e.printStackTrace();
}
}

//...
//...

   <<Less

Re: Exhausted ResultSet

Posted By:   Benoit_Quintin  
Posted On:   Thursday, May 9, 2002 12:24 PM

I am not sure what your problem is, but, out of curiosity, why are you synchronizing on your statement ? Because if you are using that statement and it's resultset in many places, you might have bizarre race conditions, no??
About | Sitemap | Contact