theLog.printDebugInfo("settimage :: trying to insert image");
// setting values
- String sql = "update images set img_height='"+webdbImage.getImageHeight() +
+ LargeObjectManager lom;
+ java.sql.Connection jCon;
+ jCon = ((com.codestudio.sql.PoolManConnectionHandle)con)
+ .getNativeConnection();
+ lom = ((org.postgresql.Connection)jCon).getLargeObjectAPI();
+ int oidImage = lom.create();
+ int oidIcon = lom.create();
+ LargeObject lobImage = lom.open(oidImage);
+ LargeObject lobIcon = lom.open(oidIcon);
+ lobImage.write(imageData);
+ lobIcon.write(iconData);
+ lobImage.close();
+ lobIcon.close();
+ String sql = "update images set img_height='"
+ +webdbImage.getImageHeight() +
"',img_width='" + webdbImage.getImageWidth() +
"',icon_height='" + webdbImage.getIconHeight() +
- "',icon_width='" + webdbImage.getIconWidth() + "', image_data=?, icon_data=? where id="+getId();
+ "',icon_width='" + webdbImage.getIconWidth()
+ + "', image_data="+oidImage+", icon_data="+oidIcon
+ +" where id="+getId();
theLog.printDebugInfo("settimage :: updating sizes: "+ sql);
pstmt = con.prepareStatement(sql);
- pstmt.setBytes(1, imageData);
- pstmt.setBytes(2, iconData);
+ //pstmt.setBytes(1, imageData);
+ //pstmt.setBytes(2, iconData);
pstmt.executeUpdate();
sql="update content set is_produced='0' where to_media="+getId();
pstmt = con.prepareStatement(sql);