I believe that when you closed stmt1, you lost rs1.  Try keeping both statements opened until you finish processing the ResultSet's.
    (*Chris*)
 
----- Original Message -----
From: qian jianhua
To: [EMAIL PROTECTED]
Sent: Thursday, April 29, 1999 10:53 PM
Subject: another SQLException

I'm sorry, but my following code again throws a SQLException, it can't pass through the "If(r1&&r2){}"statement.
 
con.setAutoCommit(false);
          
           Statement stmt1=con.createStatement();
           String query1="select * from customer_binfo where customer_num="+customernum;          
           ResultSet rs1=stmt1.executeQuery(query1);
           stmt1.close();
          
           Statement stmt2=con.createStatement();
           String query2="select * from customer where customer_num="+customernum;         
           ResultSet rs2=stmt2.executeQuery(query2);
           stmt2.close();
          
           con.commit();
           con.setAutoCommit(true); 

           boolean r1=rs1.next();
           boolean r2=rs2.next();        
           if (r1&&r2){
             String gender=rs1.getString(2);
             int age=rs1.getInt(3);
            .....
 
And the exception is:
SQLException:S1010 [Microsoft][ODBC Driver Manager] Function sequence error 0
 
Who can tell me the reason?
Thank you.

Reply via email to