I have the following code. Just a code to fill up the BLOB column in database.
--------------------------------------------------------------------
String template = "select picture from picture where id = ?";
Blob picture = null;
PreparedStatement statement = connection.prepareStatement(template);
statement.setString(1,values[0]);
ResultSet resultSet = statement.executeQuery();
while(resultSet.next())
{
picture = ((OracleResultSet)resultSet).getBlob(1);
}
File binaryFile = new File("fileName");
FileInputStream instream = new FileInputStream(binaryFile);
OutputStream outstream = picture.getBinaryOutputStream();
int size = picture.getBufferSize();
byte[] buffer = new byte[size];
int length = -1;
while ((length = instream.read(buffer)) != -1)
outstream.write(buffer, 0, length);
instream.close();
outstream.close();
---------------------------------------------------------------------------
When I compile it, the compiler cannot find the method getBinaryOutputStream(); and getBufferSize(); What problem do I have ?
Thank you for you help and looking for your replies.