-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: string representation of a datetime value is incorrect
PostPosted: Mon Jul 17, 2006 3:29 am 
Beginner
Beginner

Joined: Fri Jun 16, 2006 7:47 am
Posts: 27
I have a composite key, of which there is a timestamp value as one of them.
However, hibernate gives the error: cannot perform look up's for timestamps.

Hence, i changed the datatype of the timestamp to string and am able to persist the column.

However, the same thing is not working for my colleague, the reason being he is using an upgraded version of db2.
He is getting the error "JDBCException E org.hibernate.util.JDBCExceptionReporter [IBM][CLI Driver][DB2] SQL0180N [i][b]The syntax of the string representation of a datetime value is incorrect.[/b][/i] SQLSTATE=22007"

Is there a way out ?
I mean, is there a way to persist the timestamp by doing something else?


Appreciate any help in this regard.
Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 17, 2006 3:40 pm 
Newbie

Joined: Fri Jun 09, 2006 7:22 am
Posts: 8
I am having a similar problem. I am using Sybase ASE. I have date fields stores as Timestamp. In my Hibernate mapping files I have set the "type" as java.sql.Timestamp. When I try to retrieve objects I get the following exception. The following was thrown when I had requested all rows of a table to bereturned (i.e. there was no where clause). How do I specify the Timestamp format (without changing anyting on the database )

Code:

by: java.sql.SQLException: JZ009: Error encountered in conversion.  Error message: java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff
   at com.sybase.jdbc2.jdbc.ErrorMessage.raiseError(ErrorMessage.java:485)
   at com.sybase.jdbc2.jdbc.Convert.objectToTimestamp(Convert.java:497)
   at com.sybase.jdbc2.jdbc.Convert.objectToDateObject(Convert.java:565)
   at com.sybase.jdbc2.tds.TdsJdbcInputStream.getDateObject(TdsJdbcInputStream.java:812)
   at com.sybase.jdbc2.jdbc.SybResultSet.getTimestamp(SybResultSet.java:291)
   at com.sybase.jdbc2.jdbc.SybResultSet.getTimestamp(SybResultSet.java:401)
   at org.hibernate.type.TimestampType.get(TimestampType.java:30)
   at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:113)
   at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:102)
   at org.hibernate.type.AbstractType.hydrate(AbstractType.java:81)
   at org.hibernate.type.ComponentType.hydrate(ComponentType.java:506)
   at org.hibernate.type.ComponentType.nullSafeGet(ComponentType.java:229)
   at org.hibernate.type.ManyToOneType.hydrate(ManyToOneType.java:95)
   at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:1983)
   at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1372)
   at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1300)
   at org.hibernate.loader.Loader.getRow(Loader.java:1197)
   at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:569)
   at org.hibernate.loader.Loader.doQuery(Loader.java:689)
   at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
   at org.hibernate.loader.Loader.loadEntity(Loader.java:1785)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.