Re: DatabaseMetaData and Transactions

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: DatabaseMetaData and Transactions
Дата
Msg-id Pine.BSO.4.56.0506071125270.6588@leary.csoft.net
обсуждение исходный текст
Ответ на Re: DatabaseMetaData and Transactions  (Carl Olivier <carl@zero-one.co.za>)
Список pgsql-jdbc

On Tue, 7 Jun 2005, Carl Olivier wrote:

> In 7.3 (using the 7.3 JDBC driver) we were able to do the following:
>
> === SNIP ===
>
> if (value == null)
> {
>     stmt.setString( index, null );
> }
>
> Now, using PostgreSQL 8 (and the new JDBC driver for 8) we ARE still able to
> do that when using a 7..3 db server, but get the following error when using
> a version 8 PGSQL server:
>
> ERROR: column "created_by" is of type integer but expression is of type
> character varying
>
> Where created_by is being passed a NULL value (using the setString(index,
> null) method).
>

If you don't know what the type is you shouldn't use setString, instead
try setObject(index, null) or setNull(index, Types.OTHER) which should
work as you desire.

Kris Jurka

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

Предыдущее
От: Carl Olivier
Дата:
Сообщение: Re: DatabaseMetaData and Transactions
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: Probleme with jdbc driver an openxhange.