Re: Storing Large Objects: ClassCastException

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: Storing Large Objects: ClassCastException
Дата
Msg-id 406F4E25.7090005@opencloud.com
обсуждение исходный текст
Ответ на Storing Large Objects: ClassCastException  (Carter Harrison <gtg459b@mail.gatech.edu>)
Список pgsql-jdbc
Carter Harrison wrote:
> I'm using Java to write an application that needs the ability to store
> and retrieve pdf files from a postgresql database. I'm using the code
> from the postgresql docs to store a pdf. At the bottom of this message
> is the code I'm using but right here is the line that is producing a
> ClassCastException:
>
> LargeObjectManager lobj =
> ((org.postgresql.PGConnection)conn).getLargeObjectAPI();

Are you using a connection pooling implementation?

If so, are you using a recent (CVS is probably safest) driver? In older
drivers the proxy connection objects produced by the driver (and
commonly used by connection pools) failed to implement PGConnection.

Failing that, is it possible that your client code is loading the
postgresql classes (org.postgresql.PGConnection in this case) via a
different classloader to the classloader that loaded the JDBC driver itself?

-O

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

Предыдущее
От: Carter Harrison
Дата:
Сообщение: Storing Large Objects: ClassCastException
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: AJ1Stmt.setObject()