This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am calling PL/SQL from my java program to insert data into a table with 20 coloumns. I am using OCI driver to connect to DB. All columns are of type NUMBER. It works fine if I use 7 columns of the table to insert data. If I use more than 7 columns then I get this error while running the program:
java.sql.SQLException: Data size bigger than max size for this type: oracle.jdbc.oci8.OCIDBStatement@dc840f
That error typically comes when you try to inset a value that is too wide for the data type of the field you are trying to insert into. What is the precision of the eighth column in your insert statement?
Alternatively, why are you using a 8i OCI driver? A good way to get rounnd mystery issues with Oracle drivers is just to upgrade the driver. The 11g drivers will work just fine against a 8i database (and have the added benefit of being supported by Oracle). Worth a try. [ July 15, 2008: Message edited by: Paul Sturrock ]
It almost sounds like the OCI driver is passing the statement itself as a parameter and declaring the parameter with an incorrect size. I have seen something like this before with Oracle (though it was years ago and the query was huge). Is your SQL itself very large?
And i hope by 11g driver you mean 'thin' driver. i tried using the same before opting to OCI. It was giving "Unsupported feature" exception.
What feature was unsupported? I thought the latest driver was fully JDBC 4 complient?