Beginner |
|
Joined: Fri Nov 28, 2003 11:21 am Posts: 49 Location: Buenos Aires, Argentina
|
Hi:
Im trying to insert an image in a sqlserver Image field.
I have read the post about inserting blob with byte arrays ,and use the binaryblobtype class but with no success .
[b]Hibernate version:[/b] 2
[b]Mapping documents:[/b]
<property name="icono" column="a_Icono" type="chequeo.BinaryBlobType"/>
[b]Code between sessionFactory.openSession() and session.close():[/b]
private byte[] icono ;
public byte[] getIcono() {
return this.icono;
}
public void setIcono(byte[] icono) {
this.icono = icono;
}
[b]Full stack trace of any exception that occurs:[/b]java.lang.ClassCastException
at com.microsoft.jdbc.sqlserver.tds.TDSRPCParameter.initializeUserParam(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.addUserParametersToRPC(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.execute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.executeUpdateInternal(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.executeUpdate(Unknown Source)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:233)
at net.sf.hibernate.persister.NormalizedEntityPersister.update(NormalizedEntityPersister.java:695)
at net.sf.hibernate.persister.NormalizedEntityPersister.update(NormalizedEntityPersister.java:670)
at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2414)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2368)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2236)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
at ar.clarin.fwjava.boss.BossHibernate.saveOrUpdate(BossHibernate.java:163)
[b]Name and version of the database you are using:[/b]sqlserver 2000,jdbc microsoft driver.
[b]The generated SQL (show_sql=true):[/b]
[b]Debug level Hibernate log excerpt:[/b]
|
|