java.sql.SQLException: Exhausted Resultset
From: Phi <nnphi2304_at_gmail.com>
Date: 19 Mar 2005 20:13:57 -0800
Message-ID: <a8dcada7.0503192013.775ffe67_at_posting.google.com>
Hi all,
[Quoted] [Quoted] This is the code which i use to test connecting to Oracle db. [Quoted] But it says "Exhausted Resultset"
[Quoted] Please give a look and help me to fix this funny bug. Cheer,
Phi. Received on Sun Mar 20 2005 - 05:13:57 CET
Date: 19 Mar 2005 20:13:57 -0800
Message-ID: <a8dcada7.0503192013.775ffe67_at_posting.google.com>
Hi all,
[Quoted] [Quoted] This is the code which i use to test connecting to Oracle db. [Quoted] But it says "Exhausted Resultset"
System.out.println("Connecting..."); [Quoted] Connection conn = DriverManager.getConnection ("jdbc:oracle:oci:_at_" + database, user, password); [Quoted] Statement stmt = conn.createStatement(); ResultSet rset = stmt.executeQuery ("SELECT id,name FROM pmain"); [Quoted] System.out.println(rset.findColumn("Name")); rset.next(); [Quoted] System.out.println(rset.getString(1)); [Quoted] // close the result set, the statement and connect rset.close(); stmt.close(); conn.close(); System.out.println("Your JDBC installation is correct.");
pmain has two rows.
ID NAME
---------- --------------------------------------------------------------------- 1 Phi 2 Tram
[Quoted] Please give a look and help me to fix this funny bug. Cheer,
Phi. Received on Sun Mar 20 2005 - 05:13:57 CET