Re: 8.x driver with EJB CMP

Поиск
Список
Период
Сортировка
От
Тема Re: 8.x driver with EJB CMP
Дата
Msg-id 4F61EAB5B670854A80F7365549454E160157AB0F@jacexchange02.gc.gov
обсуждение исходный текст
Ответ на 8.x driver with EJB CMP  (<Sunil.Vishnubhotla@gwinnettcounty.com>)
Ответы Re: 8.x driver with EJB CMP  (Oliver Jowett <oliver@opencloud.com>)
Список pgsql-jdbc
Thanks O,

The same code works like a charm when I revert back to 7.4x JDBC driver with PGSql 8.x. Could it be the way the 8.x
driversare implemented? 

Thanks,

-----Original Message-----
From: Oliver Jowett [mailto:oliver@opencloud.com]
Sent: Tuesday, June 07, 2005 5:42 PM
To: Vishnubhotla, Sunil
Cc: pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] 8.x driver with EJB CMP

Sunil.Vishnubhotla@gwinnettcounty.com wrote:

> I am using JBoss 4.x with PosrgreSQL 8.x JDBC
> postgresql-8.0-311.jdbc3.jar. I have a CMP EJB that has a setter:
>
> void setCreationDate(java.sql.Date creationDate);
>
> When I use the setter in my ejbCreate() call:
>
> setCreationDate( new java.sql.Date( new java.util.Date().getTime() ) );
>
> it throws an SQLException : Could not create
> entity:java.sql.SQLException: ERROR: column "creation_date" is of type
> date but expression is of type character varying.
>
> What am i doing wrong ??

I guess that the JBoss CMP layer is using setString() instead of
setDate() (or setObject(..., Types.VARCHAR) not setObject(...,
Types.DATE)) to set the parameter in question. I'm not familiar with the
JBoss CMP layer, but can you configure it to use setDate() / Types.DATE?
Alternatively, change your schema to have creation_date as a text type.

-O

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

Предыдущее
От: Fernando Hartmann
Дата:
Сообщение: Re: Num of returned ROWS
Следующее
От: Stefan Grasse
Дата:
Сообщение: FW: PostgreSQL JDBC Installation