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)