if (rs.next()) {
LargeObject lob = lom.open(rs.getInt(1));
img_data = lob.read(lob.size());
- System.err.println("LOB IMG SIZE: "+lob.size());
lob.close();
- System.err.println("res set img NOT NULL2");
//img_data = rs.getBytes(1);
}
rs.close();
return img_data;
}
- public void setImage(byte[] uploadData)
+ public void setImage(byte[] uploadData, String type)
throws StorageObjectException {
if (uploadData!=null) {
try {
theLog.printDebugInfo("settimage :: making internal representation of image");
- WebdbImage webdbImage= new WebdbImage(uploadData);
+ WebdbImage webdbImage= new WebdbImage(uploadData, type);
theLog.printDebugInfo("settimage :: made internal representation of image");
byte[] imageData = webdbImage.getImage();
theLog.printDebugInfo("settimage :: getImage");
byte[] iconData = webdbImage.getIcon();
theLog.printDebugInfo("settimage :: getIcon");
+
if (iconData!=null && imageData!=null) {
con = theStorageObject.getPooledCon();
con.setAutoCommit(false);
.getNativeConnection();
lom = ((org.postgresql.Connection)jCon).getLargeObjectAPI();
if(rs!=null) {
- System.err.println("res set NOT NULL");
if (rs.next()) {
LargeObject lob = lom.open(rs.getInt(1));
img_data = lob.read(lob.size());
- System.err.println("LOB SIZE: "+lob.size());
lob.close();
- System.err.println("res set NOT NULL2");
//img_data = rs.getBytes(1);
- System.err.println("res set NOT NULL3");
}
rs.close();
}