Bug in getClob() in 7.2 jdbc2 driver?

Поиск
Список
Период
Сортировка
От Grant Goodale
Тема Bug in getClob() in 7.2 jdbc2 driver?
Дата
Msg-id C2628B4FD1FD6B4EB3F2479F9124A1293FBEDC@MAILSERVER.reactivity.com
обсуждение исходный текст
Список pgsql-jdbc
    Hello,

    I'm trying to access a TEXT column (call it "foo") in a 7.1.3
table via getClob().  However, I'm receiving the following SQLException:

    Bad Integer: <contents of "foo">
        at org.postgresql.jdbc2.ResultSet.toInt(ResultSet.java:1481)
        at org.postgresql.jdbc2.ResultSet.getInt(ResultSet.java:247)
        at org.postgresql.jdbc2.ResultSet.getClob(ResultSet.java:980)
        at org.postgresql.jdbc2.ResultSet.getClob(ResultSet.java:972)
        ... and off into my code.

    In my code, I'm calling ResultSet.getClob(columnName) with a valid
column name, which winds up in getClob(int i):

        public Clob getClob(int i) throws SQLException
        {
                return new org.postgresql.largeobject.PGclob(connection,
getInt(i));
        }

    After looking through the code, it would appear that the problem
lies in getClob()'s use of getInt():

        public int getInt(int columnIndex) throws SQLException
        {
                return toInt( getFixedString(columnIndex) );
        }

    The comments above getFixedString() (which converts a string
containing monetary data into a proper integer) suggest that getInt()
should be called when working with a column's data, but the results of
getInt() are being passed to the constructor of PGclob!

    Am I just misusing this function?  Any help would be greatly
appreciated.

    Regards,

      Grant Goodale
      grant@reactivity.com

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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: build.xml patch
Следующее
От: "Adebayo A. Alabi"
Дата:
Сообщение: questions