Skip site navigation (1) Skip section navigation (2)

Re: ResultSet.previous() - ArrayIndexOutOfBoundsException

From: Kris Jurka <books(at)ejurka(dot)com>
To: Fischer Krisztián <fischer(at)borganization(dot)com>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: ResultSet.previous() - ArrayIndexOutOfBoundsException
Date: 2004-01-20 02:21:45
Message-ID: Pine.LNX.4.33.0401192119090.11604-200000@leary.csoft.net (view raw or flat)
Thread:
Lists: pgsql-jdbc

On Mon, 19 Jan 2004, Kris Jurka wrote:

>
>
> On Mon, 19 Jan 2004, [ISO-8859-2] Fischer Krisztin wrote:
>
> > Hi!
> >
> > I use PostgreSQL 7.4.1 through the shipped JDBC driver. In some
> > circumstances the driver throws the following exception:
> >
> > [...]
> > java.lang.ArrayIndexOutOfBoundsException: 1 >= 0
> >          at java.util.Vector.elementAt(Vector.java:431)
> >          at
> > org.postgresql.jdbc2.AbstractJdbc2ResultSet.previous(AbstractJdbc2ResultSet.java:495)
> >          at
> > com.bh.server.implementation.SQLObject.previousRow(SQLObject.java:583)
>
>
> Here's a sample program to demonstrate the problem.  Basically it assumes
> that rs.next() won't be called after it returns false.  The same problem
> is also true in reverse, calling previous and then next will show the same
> issue.  I should hopefully have a patch for this later today.
>

I have applied a patch to fix this problem to the cvs version on gborg.
Here is the equivalent patch for the 7.4 series driver.

Kris Jurka

Attachment: prevnext.patch
Description: text/plain (7.0 KB)

In response to

Responses

pgsql-jdbc by date

Next:From: Frequency UnKnownDate: 2004-01-20 04:53:06
Subject: JDBC woes SOLVED!!!
Previous:From: Kris JurkaDate: 2004-01-20 01:56:32
Subject: JDBC Driver moved to gborg.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group