开发者

writing byte array to a raw column in oracle

开发者 https://www.devze.com 2023-02-02 11:03 出处:网络
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 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消