I wan to have two ResultSet pointing to a table,
or two ResultSet which each of them points to one
table , I have written the following code for the
first case, but I throws me an exception, would you
please let me know if the code is right, or if it
isn’t correct, please let me know the right code?
Here is the code,
String url = "jdbc:odbc:LocalServer";
String query = "SELECT * FROM t1 ORDER BY phrase
ASC";
String query1="SELECT * from X ORDER BY phrase1
ASC";
try {
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection
(url);
Statement stmt = con.createStatement ();
ResultSet rs = stmt.executeQuery (query);
ResultSet rs1=stmt1.executeQuery(query1);
while(rs.next()){
System.out.println("hello");
} //while
stmt.close();
con.close();
} //try