How can I run Multiple Query in A Single ResultSet ?
Example---
String st1="select sum(salary) from v_table where id=2 and post!='manager'";
String st2="select sum(salary) from v_table where post!='staff'";
java.sql.Connection con=....
java.sql.Statement st=con.createStatement();
java.sql.ResultSet rs=st.executeQuery(st1); //-----I put one String ...
while(rs.next()){
//dosome thing.
}
java.sql.ResultSet rs1=st.executeQuery(st2); ///---------I put second string
while(rs1.next()){
//dosome thing.
}
NOTE: I need Only one result Set. and one loop while(rs.next() but the rs content both two result
Like AddBatch--->
java.sql.Statement stmt=con.createStatement();
stmt.addBatch(insert_query1); //insert_query1="insert intto table1 values....
stmt.addBatch(insert_query2); //insert_query2 ="insert intto table2 values....
int[] inserts = stmt.executeBatch(); // both table insert complet