Re: java.sql.SQLException: Exhausted Resultset

From: Faroch Hordil <fred1231_at_anon.com>
Date: Sun, 20 Mar 2005 12:13:15 -0000
Message-ID: <1111320790.22476.0_at_demeter.uk.clara.net>


You are using the Oracle driver. Have you registered it?

If not, put this before your attempt at getting a connection objekt

      DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

Fred

"Phi" <nnphi2304_at_gmail.com> wrote in message news:a8dcada7.0503192013.775ffe67_at_posting.google.com...
> Hi all,
> This is the code which i use to test connecting to Oracle db.
> But it says "Exhausted Resultset"
>
> System.out.println("Connecting...");
> Connection conn = DriverManager.getConnection
> ("jdbc:oracle:oci:_at_" + database, user,
> password);
>
> Statement stmt = conn.createStatement();
>
> ResultSet rset = stmt.executeQuery ("SELECT id,name FROM
> pmain");
>
> System.out.println(rset.findColumn("Name"));
> rset.next();
> System.out.println(rset.getString(1));
> // 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
> Please give a look and help me to fix this funny bug.
> Cheer,
> Phi.
Received on Sun Mar 20 2005 - 13:13:15 CET

Original text of this message