Re: ResultSet with more than 5 rows causes error

From: Giuseppe Sacco <giuseppe(at)eppesuigoccas(dot)homedns(dot)org>
To: Ludovico Bianchini <metlud(at)yahoo(dot)it>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: ResultSet with more than 5 rows causes error
Date: 2007-09-27 16:27:07
Message-ID: 1190910427.18730.35.camel@scarafaggio
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Il giorno gio, 27/09/2007 alle 12.20 +0200, Ludovico Bianchini ha
scritto:
[...]
> while(source.next()) {
> insertCall.registerOutParameter(1, Types.INTEGER);
> for (int i = 1; i <= colCount; i++) {
> data = source.getObject(i);
> insertCall.setObject(i+1, data);
> }
> insertCall.execute();
[...]

I never used CallableStatement, but I do think you should use
insertCall.setObject(i,data)
instead of
insertCall.setObject(i+1,data)

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Ludovico Bianchini 2007-09-27 16:45:20 Re: ResultSet with more than 5 rows causes error
Previous Message Ludovico Bianchini 2007-09-27 16:00:37 Re: ResultSet with more than 5 rows causes error