Thread: BUG #3615: Exception with loading string value

BUG #3615: Exception with loading string value

From
"Sundarrajan"
Date:
The following bug has been logged online:

Bug reference:      3615
Logged by:          Sundarrajan
Email address:      ssuyamboo@yahoo.com
PostgreSQL version: 8.1.3
Operating system:   Windows
Description:        Exception with loading string value
Details:

I am trying to load table data using hibernate 3.1/postgres driver.

I tried with the following driver versions,
postgresql-8.2-504.jdbc2ee.jar
postgresql-8.2-506.jdbc2ee.jar
postgresql-8.2-506.jdbc3.jar


All ended up in ,
Caused by: org.postgresql.util.PSQLException: Bad value for type int :
STOREMODEL
    at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.toInt(AbstractJdbc2ResultSet.jav
a:2653)
    at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getInt(AbstractJdbc2ResultSet.ja
va:1983)
    at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getInt(AbstractJdbc2ResultSet.ja
va:2327)
    at org.hibernate.type.IntegerType.get(IntegerType.java:28)
    at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:113)
    at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:102)
    at org.hibernate.type.ManyToOneType.hydrate(ManyToOneType.java:95)
    at
org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntit
yPersister.java:1899)
    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.ja
va:224)
    at org.hibernate.loader.Loader.doList(Loader.java:2145)


This happened when my code tried to load String data of data type bpchar in
postgres. Column size used in table defn is 10 and the data length is 10.
Could you please guide me how to resolve this?

Thanks
Sundar