Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with the JDBC driver.

 
Praveen Dharmavaram
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Has anyone ever tried sending a BINARY data of about 145k to the database and succeed. I am using JDBC 2.0 Connection pooling and when i try to send a data bigger than 32K i get an CLI0102E Invalid conversion SQLSTATE-07006.
Here is the code i used.Any thoughts.
I register the parameter as
callStmt.registerOutParameter(2, Types.LONGVARBINARY);
//where b is bytes of length 145K
callStmt.setObject(2, b, Types.LONGVARBINARY);

Thanks
Praveen
 
Joe Ess
Bartender
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you say "the database", what brand database in particular are you speaking of? I've used BLOB's on MySql just fine. What JDBC driver are you using?
 
Praveen Dharmavaram
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use a db2(7.2.10) DB and client. and i get a connection using DB2 Connection pooling (COM.ibm.db2.jdbc.*).
 
Joe Ess
Bartender
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't have any experience with db2. What are you declaring the database column as? In MySql there's several TEXT and BLOB fields of differing storage capacity.
 
Praveen Dharmavaram
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well..i declare it as a BLOB. This was working when i was using JDBC 1.0 Driver. But when we upgraded to DB2(FP10) and started using the JDBC 2.0 it stopped working and gives the error mentioned earlier.
 
Joe Ess
Bartender
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, browsing around the DB2 support site I see that this is indeed a defect with DB2, but it looks like there is a fix:
HERE
 
Joe Ess
Bartender
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I lied. That link just had all the keywords on it. It does not appear to be the error you are reporting. I can't think of anything else. Check out that DB2 support site. Hopefully someone with DB2 experience will see this thread.
 
Praveen Dharmavaram
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the info. I already have a PMR open with IBM in this regard and was wondering if I was the only one facing this problem.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic