I have a java program that reads fixed-width records off of a flat file and inserts them into a table. I originally implemented it using standard JDBC PreparedStatement calls with an executeUpdate() after each record. This was 100% functional.

For increased performance, I tried using standard JDBC batch inserts with addBatch() and executeBatch() calls. Since implementing this method, every batch insert causes a BatchUpdateException:

java.sql.BatchUpdateException: ORA-01483: invalid length for DATE or NUMBER bind variable

I never received this error before converting to batch inserts. I have examined the data binding to the statements and it looks the same as before. Any ideas on what may be the problem? Is there any way to determine which of the inserts and/or bind variables that is causing the error? Are the other statements in the batch being executed or is there any way to determine which statements successfully inserted?

I am using Oracle 9i patched to 9.2.04

I tried the following code to determine which statements, if any, were successful:

catch (BatchUpdateException SQLEx) {
int[] cnts = SQLEx.getUpdateCounts();
for (int zzz = 0; zzz<cnts.length; zzz++)
System.out.println("INSERT COUNTS: "+cnts[zzz]);
}


And this is the output I receive:

INSERT COUNTS: -3
INSERT COUNTS: -3
INSERT COUNTS: -3
. . .


For each statement, over 70,000 lines are output, but there are about 20 statements per batch insert.

What's going on?!

Thanks in advance!