Thread:
 Oracle10g 
 dannyor   06 Apr 2005, 10:25 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: dannyor (06 Apr 2005, 10:25) Replies: 0, Views: 39468
Subject: Oracle10g
I have tried several of the approaches described:
1. I created the class BinaryBlobType.
2. I added the Oracle specific BLOB creation since the Oracle code
assumes that any java.sql.Blob they get is an oracle.sql.BLOB which is
not the case if you use Hibernate.createBlob().

As someone has mentioned here, the code won't run if you need jdbc
batches since the above code works with streams.

However,  if you don't mind giving up streams and holding the bytes
themselves (which is my case, since I got relatively small byte arrays)
then  using :
[code]
    public void nullSafeSet(PreparedStatement st, Object value, int index)
            throws HibernateException, SQLException {
        byte[] bytes = (byte[]) value;
        st.setBytes(index, bytes);
    }
[/code]

seems to me as the simplest way
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]