I am getting problem when I try to store large image files into blob column. I am getting ORA-01461: can bind a LONG value only for insert into a LONG column when I tried to insert large image files. It works fine for small image files. The code is as follows; PreparedStatement stmnt = conn.prepareStatement( "insert into tempfile (name,file_blob) values (?,?)");
stmnt.setString(1,"temp"); stmnt.setBinaryStream(2, new FileInputStream(file), (int) file.length()); stmnt.execute(); stmnt.close();
posted 16 years ago
Hi, Sri, I am not quite sure how big your image files are. My experience is to save the image names in Oracle and the actual image files separately. Although you can save image files in Oracle DB, you can have problem when an image file is too large. Frank W.