Quantcast
Channel: Java mon amour
Viewing all articles
Browse latest Browse all 1121

OracleDB: How to save a byte array to a BLOB field in Java

$
0
0


PreparedStatement statement= getConnection().prepareStatement("INSERT INTO MYTABLE(MYBLODFIELD) VALUES(?)");


byte binData[] = myString.getBytes();
inStream = new ByteArrayInputStream(binData)
statement.setBinaryStream(1, inStream, binData.length);
statement.executeUpdate();


Viewing all articles
Browse latest Browse all 1121

Trending Articles