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.
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 184.108.40.206.0 still getting the same exception.
Actually at oracle side stored procedures IN parameter is of BLOB type.
following is the oracle stored procedure.
PROCEDURE upload_contract (
p_blob IN BLOB,
p_naam IN VARCHAR2,
p_status OUT VARCHAR2
l_naam VARCHAR2 (4000);
l_blob := p_blob;
l_naam := p_naam;
INSERT INTO sy_blob_test VALUES (l_blob,l_naam);
p_status := 'OK';
This stored procedure is written just for testing whether BLOB gets populated in the test table or not. File with size upto 31kb get populated in SY_BLOB_TEST table. If file size goes above that(31kb) then it gives that exception. Dont know whether its a limitation of oracle BLOB or jdbc driver not able to hold bigger file data.