Hi ,
I am unable to insert a BLOB of size greater than 108544 into a DB2 table using JAVA code.
However the code works fine for BLOB size smaller than mentioned above.
I get following error:
COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0302N The value of a host variable in the EXECUTE or OPEN statement is too large for its corresponding use. SQLSTATE=22001
Here's the sample code:
stmt = con.prepareStatement(createString);
act=new File(cFile);
infile=new FileInputStream(act);
stmt.setInt(1,i);
stmt.setTimestamp(2,new Timestamp(new java.util.Date().getTime()));
stmt.setString(3,FILEPATH);
stmt.setString(4,FILE);
//stmt.setBinaryStream(5,infile,(int)(act.length()));
stmt.setBinaryStream(5,infile,infile.available());
stmt.setInt(6,version);
stmt.setString(7,"IN");
stmt.setString(8,user);
stmt.executeUpdate();
Thanks
D
---------------------------------
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
DB2 & UDB email list listserv db2-l LazyDBA home page