Re: getIndexInfo() throws NullPointerException - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: getIndexInfo() throws NullPointerException
Date
Msg-id 001401c1b8e0$047228a0$8201a8c0@inspiron
Whole thread Raw
In response to getIndexInfo() throws NullPointerException  ("Cormac Twomey" <cormac@bpallen.com>)
List pgsql-jdbc
I'd have to agree with your bet, thanks a lot

Dave

-----Original Message-----
From: Cormac Twomey [mailto:cormac@bpallen.com]
Sent: Monday, February 18, 2002 7:40 PM
To: pgsql-jdbc@postgresql.org; Dave@micro-automation.net
Subject: [JDBC] getIndexInfo() throws NullPointerException


Calling getIndexInfo against a postgresql-7.1 db with the 7.2 jdbc
driver (or with 7.3dev built 2002-02-09 ), I get the following
exception:

Exception in thread "main" java.lang.NullPointerException
        at org.postgresql.jdbc2.ResultSet.getBytes(Unknown source)
        at org.postgresql.jdbc2.DatabaseMetaData.getIndexInfo(Unknown
source)
        at foo.bar(foo.java:253)
        at foo.baz(foo.java:167)
        at foo.main(foo.java:46)

I decided to poke around in the source code and found the following
piece of questionable-looking code in
org/postgresql/jdbc2/DatabaseMetaData.jar:

...
    if (columnNameRS.next())
        tuple[8] = columnNameRS.getBytes(1);
    else
        tuple[8] = "".getBytes();
    tuple[8] = columnNameRS.getBytes(1);
...

Now, being willing to bet that that last line shouldn't be there, I
commented it out and tried it again - and bingo! it worked fine.

I see Dave Cramer's uid at the top of DatabaseMetaData.jar, so cc'ing
him.

Thanks,
--Cormac Twomey



pgsql-jdbc by date:

Previous
From: "Cormac Twomey"
Date:
Subject: getIndexInfo() throws NullPointerException
Next
From: "Cormac Twomey"
Date:
Subject: Re: getIndexInfo() throws NullPointerException