Hi!
I am using Oracle 8.1.7 with JBoss 2.4.3 and I have a BMP entity bean where the BLOB datatype from Oracle is mapped to a byte[] Array!
I am able to deploy the bean but as soon as I call this bean, I get an exception in ejbStore():
[Container factory] Deployed application: file:/D:/JBoss-2.4.3/tmp/deploy/Default/ejb11_tpcw.jar/
[J2EE Deployer Default] J2EE application: file:/D:/JBoss-2.4.3/deploy/ejb11_tpcw.jar is deployed.
[Default] Error ImageBean.ejbStore(): java.sql.SQLException: ORA-01483: invalid length for DATE- or NUMBER bind variable"
My ejbStore() method looks like:
ejbStore() {
....
if((image != null) && (thumbnail != null)) {
pstmt = conn.prepareStatement("update item set I_IMAGE = ?, I_THUMBNAIL = ? where I_ID = ?");
InputStream inImage = new ByteArrayInputStream(image);
InputStream inThumb = new new ByteeArrayInputStream(thumbnail);
pstmt.setBinaryStream(1, inImage, image.length);
pstmt.setBinaryStream(2, inThumb, thumbnail.length);
pstmt.setInt(3, id);
pstmt.executeUpdate();
}
...
}
However, if I execute those statements directly form my own JDBC application it works!!! Also, the bean has been successfuly tested in WebLogic!
Any ideas what could be wrong?
Thanks.
Markus Richter
Hi,
I am assuming that I_ID is a number ...
use instead of
pstmt.setInt(3, id);
to
pstmt.setBigDecimal(3, id);
(id should be a java.math.BigDecimal).
hope it helps