writing byte array to a raw column in oracle
I want to write a byte array to a raw column in oracle.
byte[] bArray = new byte[16];
stmt = fConnection.prepareStatement(qu开发者_高级运维ery);
I want to do something like:
stmt.setBinaryStream(1, bArray );
However, I couldn't figure out an elegant way of doing it. Can some one please throw in some pointers.
Thanks
There the setBytes()
method is for.
stmt.setBytes(1, bArray);
Click the above setBytes()
link for an overview of all methods of the PreparedStatement
class. It's called javadoc. Start familarizing you with the javadocs. They are invaluable.
精彩评论