开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜