// column is column index in ResultSet containing the image, // we assume that the type is LONGVARBINARY Image myImage = null; InputStream stream = rset.getBinaryStream(column); ByteArrayOutputStream output = new ByteArrayOutputStream(); try { int a1 = stream.read(); while (a1 >= 0) { output.write((char)a1); a1 = stream.read(); } myImage = Toolkit.getDefaultToolkit().createImage(output.toByteArray()); output.close(); } catch(Exception e){}
// we assume that the type is LONGVARBINARY
Image myImage = null;
InputStream stream = rset.getBinaryStream(column);
ByteArrayOutputStream output = new ByteArrayOutputStream();
try {
int a1 = stream.read();
while (a1 >= 0) {
output.write((char)a1);
a1 = stream.read();
}
myImage =
Toolkit.getDefaultToolkit().createImage(output.toByteArray());
output.close();
}
catch(Exception e){}