From: | Dave Cramer <Dave(at)micro-automation(dot)net> |
---|---|
To: | "G(dot)Nagarajan" <gnagarajan(at)dkf(dot)de> |
Cc: | "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org> |
Subject: | Re: jdbc cursor positioning |
Date: | 2002-10-07 16:49:39 |
Message-ID: | 1034009380.20273.20.camel@inspiron.cramers |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
Sorry,
I should have taken the move lines out, there is no way to tell if they
succeed.
Dave
On Mon, 2002-10-07 at 12:51, G.Nagarajan wrote:
> hi Dave,
>
> I get the following error when I execute the program
>
> Caught Exception: Kann Anzahl der veränderten Zeilen nicht ermitteln: MOVE
> Kann Anzahl der veränderten Zeilen nicht ermitteln: MOVE
> at
> org.postgresql.core.QueryExecutor.receiveCommandStatus(QueryExecutor.java:18
> 2)
> at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:80)
> at org.postgresql.Connection.ExecSQL(Connection.java:398)
> at org.postgresql.jdbc2.Statement.execute(Statement.java:130)
> at org.postgresql.jdbc2.Statement.executeUpdate(Statement.java:73)
> at fz.core.database.CursorTest.main(CursorTest.java:23)
>
> It tells that it cannot determine the number of modified rows.
>
> I am using Postgresql 7.1.3 and 7.2 jdbc driver. I will check with the beta
> driver and see
> if the error goes away.
>
> Regards,
> Nagarajan.
>
> > -----Original Message-----
> > From: pgsql-jdbc-owner(at)postgresql(dot)org
> > [mailto:pgsql-jdbc-owner(at)postgresql(dot)org]On Behalf Of Dave Cramer
> > Sent: Monday, October 07, 2002 3:43 PM
> > To: David Wall
> > Cc: pgsql-jdbc(at)postgresql(dot)org
> > Subject: Re: [JDBC] jdbc cursor positioning
> >
> >
> > 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(at)postgresql(dot)org)
> > >
> > >
> >
> >
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 5: Have you checked our extensive FAQ?
> >
> > http://www.postgresql.org/users-lounge/docs/faq.html
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | G.Nagarajan | 2002-10-07 16:51:34 | Re: jdbc cursor positioning |
Previous Message | G.Nagarajan | 2002-10-07 16:26:34 | Re: NullPointer error returned from ResultSet.java |