Hi Laran,
I can't say how the layers above Derby got into the situation of
requesting a character stream on an integer column. Derby does not
support that conversion. ResultSet.getCharacterStream() on an INTEGER
column is not supported, according to Appendix B (table B-6) of the JDBC
3.0 spec.
Hope this helps,
-Rick
On 5/26/11 3:37 PM, Laran Evans wrote:
I'm not sure if this is an issue with the Derby driver or Hibernate. I
do know that it surfaced after upgrading Hibernate to 3.5.6 Final from
3.3.2. Final.
Any suggestions as to what might cause this? We've tried with several
different versions of Derby without success.
Caused by: java.sql.SQLDataException: An attempt was made to get a
data value of type 'java.sql.Types 4' from a data value of type
'java.io.Reader'.
at
org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown
Source)
at org.apache.derby.client.am.SqlException.getSQLException(Unknown
Source)
at org.apache.derby.client.am.ResultSet.getCharacterStream(Unknown
Source)
at org.apache.derby.client.am.ResultSet.getCharacterStream(Unknown
Source)
at
org.apache.commons.dbcp.DelegatingResultSet.getCharacterStream(DelegatingResultSet.java:299)
at
org.hibernate.type.AbstractLongStringType.get(AbstractLongStringType.java:54)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:186)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:212)
at
org.hibernate.loader.criteria.CriteriaLoader.getResultColumnOrRow(CriteriaLoader.java:148)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:647)
at org.hibernate.loader.Loader.doQuery(Loader.java:745)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)
at org.hibernate.loader.Loader.doList(Loader.java:2449)
... 42 more
Caused by: org.apache.derby.client.am.ColumnTypeConversionException:
An attempt was made to get a data value of type 'java.sql.Types 4'
from a data value of type 'java.io.Reader'.
at org.apache.derby.client.am.Cursor.getCharacterStream(Unknown
Source)
... 53 more
Thanks!