Skip site navigation (1) Skip section navigation (2)

Re: 8.x driver with EJB CMP

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Sunil(dot)Vishnubhotla(at)gwinnettcounty(dot)com
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: 8.x driver with EJB CMP
Date: 2005-06-07 21:42:14
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
Sunil(dot)Vishnubhotla(at)gwinnettcounty(dot)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.


In response to

pgsql-jdbc by date

Next:From: Oliver JowettDate: 2005-06-07 21:43:53
Subject: Re: exception while upgrading driver
Previous:From: Oliver JowettDate: 2005-06-07 21:38:34
Subject: Re: DatabaseMetaData and Transactions

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group