getIndexInfo() throws NullPointerException

Поиск
Список
Период
Сортировка
От Cormac Twomey
Тема getIndexInfo() throws NullPointerException
Дата
Msg-id 00a201c1b8dd$f9fff930$6501a8c0@firbolg
обсуждение исходный текст
Ответ на Re: getIndexInfo() fails  ("Dave Cramer" <Dave@micro-automation.net>)
Ответы Re: getIndexInfo() throws NullPointerException  ("Dave Cramer" <Dave@micro-automation.net>)
Список pgsql-jdbc
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
workedfine. 

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

Thanks,
--Cormac Twomey


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

Предыдущее
От: Paulo Delgado
Дата:
Сообщение: Re: JDBC + PostgreSQL + LargeObjects
Следующее
От: "Dave Cramer"
Дата:
Сообщение: Re: getIndexInfo() throws NullPointerException