You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Stefan Schlösser <ss...@intermediate.de> on 2003/03/10 16:20:49 UTC

HSQL Timestamp sql exception illegal format

Hi,

when a try insert something into a HSQL DB with a timestamp I get a

java.sql.SQLException: Wrong data type: Timestamp format must be yyyy-
mm-dd hh:mm:ss.fffffffff

Swifting through the docs brought mew to the conclusion that my 
timestamp is declared as a java.util.date in the object to be stored 
and HSQL seems to expect a java.sql.Date object.

Is there a way to let ojb handle this, or do I need to write a 
specialised repository_user_hsql.xml to contain hsql specific 
conversion routines?

My coding works fine when connecting to a SAPDB.

What to do ?

Cheers,
  Stefan


Re: HSQL Timestamp sql exception illegal format

Posted by Thomas Mahler <th...@web.de>.
See http://db.apache.org/ojb/jdbc-types.html
You can use the JavaDate2SqlDate FieldConversion for this task

cheers,
Thomas

Stefan Schlösser wrote:
> Hi,
> 
> when a try insert something into a HSQL DB with a timestamp I get a
> 
> java.sql.SQLException: Wrong data type: Timestamp format must be yyyy-
> mm-dd hh:mm:ss.fffffffff
> 
> Swifting through the docs brought mew to the conclusion that my 
> timestamp is declared as a java.util.date in the object to be stored 
> and HSQL seems to expect a java.sql.Date object.
> 
> Is there a way to let ojb handle this, or do I need to write a 
> specialised repository_user_hsql.xml to contain hsql specific 
> conversion routines?
> 
> My coding works fine when connecting to a SAPDB.
> 
> What to do ?
> 
> Cheers,
>   Stefan
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
>