Hi All,
I am working on
struts 1.x application. In that I am trying to upload file as blob in oracle database. I dont want to update the oracle table directely, I need to pass the file as a blob to oracle stored procedure as IN parameter.
I did the follwong things.
FormFile uploadFile = (FormFile)uploadForm.get("uFile");
InputStream inputFile = uploadFile.getInputStream();
String fileName = uploadFile.getFileName();
..
CallableStatement stmt = conn.prepareCall("{call UPLOAD_FILE(?,?,?)}");
stmt.setBinaryStream(1, inputFile, inputFile.available());
stmt.setString(2,fileName);
stmt.registerOutParameter(3, Types.VARCHAR);
I am using CallableStatement's setBinaryInputStream() and is working fine for max file size 31kb, but my file size would be around 300kb. When I tried with file size 300kb its giving following exception:
java.sql.SQLException Data size bigger than max size for this type: 275091
I tried with CallableStatement's setBlob() but its not working, its giving java.lang.AbstractMethodError exception.
At some forum I found that this is the problem with
JDBC driver version 10.1.0.5.0 but my JDBC driver version is 11.2.0.3.0 still getting the same exception.
Please help me to solve this.
Thanks,
Aniket