I have a table with a column of type XML. When I insert a record into this table from a servlet running in WebSphere on Windows, the insert succeeds. However, when I run exactly the same code in WebSphere on AIX, I get the following exception:
com.ibm.db2.jcc.c.SqlException: Illegal Conversion: Can not convert from "java.lang.String" to "java.sql.Blob"
at com.ibm.db2.jcc.c.r.a(r.java:695)
at com.ibm.db2.jcc.c.uf.b(uf.java:927)
at com.ibm.db2.jcc.c.uf.setString(uf.java:910)
at com.ibm.ws.rsadapter.spi.InternalGenericDataStoreHelper.psSetString(InternalGenericDataStoreHelper.java:554)
at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.setString(WSJdbcPreparedStatement.java:1662)
at org.hibernate.type.StringType.set(StringType.java:49)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:154)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:131)
at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2015)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2261)
... 33 more
I'm running WebSphere 6.1 against a DB2 version 9, z/OS database.
Because of the platform difference, this feels alot like an encoding problem. But who knows. Any advice?