Unix Technical Forum

Re: 8.x driver with EJB CMP

This is a discussion on Re: 8.x driver with EJB CMP within the pgsql Interfaces jdbc forums, part of the PostgreSQL category; --> Thanks O, The same code works like a charm when I revert back to 7.4x JDBC driver with PGSql ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces jdbc

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-15-2008, 11:19 PM
Sunil.Vishnubhotla@gwinnettcounty.com
 
Posts: n/a
Default Re: 8.x driver with EJB CMP

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 drivers are implemented?

Thanks,

-----Original Message-----
From: Oliver Jowett [mailtoliver@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

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-15-2008, 11:19 PM
Oliver Jowett
 
Posts: n/a
Default Re: 8.x driver with EJB CMP

Sunil.Vishnubhotla@gwinnettcounty.com wrote:

> 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 drivers are implemented?


Yes, the 8.x drivers changed to make full use of the V3 protocol, which
involves pushing parameter substitution to the backend. Previous drivers
did textual substitution into the query, which had slightly different
behaviour but limited what could be done in the way of streaming large
parameter values and preserving query plans between executions.

-O

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:34 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com