Re: jdbc cursor positioning

Поиск
Список
Период
Сортировка
От Dave Cramer
Тема Re: jdbc cursor positioning
Дата
Msg-id 1033998193.1776.1.camel@inspiron.cramers
обсуждение исходный текст
Ответ на Re: jdbc cursor positioning  ("David Wall" <d.wall@computer.org>)
Ответы Re: jdbc cursor positioning  ("G.Nagarajan" <gnagarajan@dkf.de>)
Список pgsql-jdbc
This is a sample program which uses cursors

      con = getConnection();
      con.setAutoCommit( false );
      Statement stmt = con.createStatement();

      int result = stmt.executeUpdate( "declare test cursor for select *
from orders" );
      System.out.println( "Created cursor, result is " + result );
      result = stmt.executeUpdate( "move 0 in dave");
      result = stmt.executeUpdate( "move -"+result+"in dave");

      for(;;)
      {
    rs = stmt.executeQuery("fetch forward 5 in test");
        if ( !rs.next() )
      break;
      }

      while(rs.next()){
        System.out.println("Id -->" + rs.getObject(1).toString());
      }
      rs.close();
      con.commit();
      con.close();


Dave
On Sun, 2002-10-06 at 22:57, David Wall wrote:
> > No, postgres fully supports cursors, the problem must be somewhere else.
>
> How do you make use of them from JDBC?
>
> David
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
>




В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Felipe Schnack
Дата:
Сообщение: OFF-TOPIC: cvs
Следующее
От: Jeff Duffy
Дата:
Сообщение: NullPointer error returned from ResultSet.java