In VJ++ use JDBC get "invalid cursor state" error

In VJ++ use JDBC get "invalid cursor state" error

Post by Leo Han » Mon, 31 May 1999 04:00:00



I write very simple code as follows,
 ....
  String ss;
 try{
   Class.forName("com.ms.jdbc.odbc.JdbcOdbcDriver");
   Connection con = DriverManager.getConnection
 ("jdbc:odbc:pdfdoc","fulcrum","fulcrum");
  con.setTransactionIsolation(con.TRANSACTION_READ_COMMITTED);
  Statement stmt = con.createStatement();

  ResultSet rs = stmt.executeQuery("select * from pdfdoc");
   column = rs.findColumn("status");

   ss = rs.getString(column);  //here catch "invalid cursor state " error
        ...

Quote:}

catch(SQLException e)
        {
        ...

        }

I'm new to java ,any suggestion will appreciate.

-----------------** -- Posted from CodeGuru -- **-----------------
http://www.codeguru.com/java     The website for Java programmers.

 
 
 

In VJ++ use JDBC get "invalid cursor state" error

Post by Liu Xing Ha » Mon, 31 May 1999 04:00:00


You must add
 rs.next();


>I write very simple code as follows,
> ....
>  String ss;
> try{
>   Class.forName("com.ms.jdbc.odbc.JdbcOdbcDriver");
>   Connection con = DriverManager.getConnection
> ("jdbc:odbc:pdfdoc","fulcrum","fulcrum");
>  con.setTransactionIsolation(con.TRANSACTION_READ_COMMITTED);
>  Statement stmt = con.createStatement();

>  ResultSet rs = stmt.executeQuery("select * from pdfdoc");
>   column = rs.findColumn("status");

       rs.next(); //add this one

Quote:>   ss = rs.getString(column);  //here catch "invalid cursor state " error
>    ...
>}
>catch(SQLException e)
>    {
>    ...

>    }

>I'm new to java ,any suggestion will appreciate.

>-----------------** -- Posted from CodeGuru -- **-----------------
>http://www.codeguru.com/java     The website for Java programmers.

-----------------** -- Posted from CodeGuru -- **-----------------
http://www.codeguru.com/java     The website for Java programmers.

 
 
 

1. SQL 7.0 error "Invalid Cursor State"

HI,

I'm developing a DB with SQL 7.0  I've created a table with an integer
field.  Every record has 0 in this field.  I've changed my mind and would
like to change the data type to decimal.  When I attempt to make this
change, I get the "Invalid Cursor State" error.  I've tried deleting the
field and recreating it, with the same result.  The DB and logs are well
below their maximum size limits.

What's going on? Do I need to delete the whole table and re-create it?

TIA,

Ron Walters

2. PDOX40 runtime question

3. "Invalid cursor state" error

4. OLAP: Where to Start? - Need Advice

5. "Invalid cursor state" / Error 0x80004005

6. Destroying many ABF frames

7. "Invalid cursor state"

8. Export Access table to Sql Server

9. ODBC "invalid cursor state"

10. "Cursor state not valid.", AS400 JDBC, IBM JTOpen 3.0

11. "Ref cursor is invalid"- Oracle, JDBC, Java, and me

12. Error "Bad cursor state"