creating BLOB's.. may be a off topic
- Hello all,Blob in java.sql is interface.When recieved via ResultSet is easy to get a BLOB.But how to send a BLOB into database. I have done it via file,but the situation is that I have created Image (from IconImage) andI want to send this Image into BLOB...Can some one helpNiki
- --- In Firebird-Java@yahoogroups.com, "Nikolay Ivanchev"
> Hello all,You can set blob via java.sql.PreparedStatement object:
> Blob in java.sql is interface.
> When recieved via ResultSet is easy to get a BLOB.
> But how to send a BLOB into database. I have done it via file,
> but the situation is that I have created Image (from IconImage) and
> I want to send this Image into BLOB...
> Can some one help
byte blob_val =...
PreparedStatement pstmt = con.prepareStatement("INSERT INTO
blob_table (ID, BLOB_COL) VALUES (?, ? )");
pstmt.setBinaryStream(2, new ByteArrayInputStream(blob_val),
//or via another setXXX method