Batch Insert via SQLJ from Java and cast expression is not supported
We want to insert many rows from java applications on Unix in DB2 on z/OS via SQLJ with a good performance. Typically we do this with Batch-mode (execCtx.setBatching(true) inserts. But there are limitations concerning cast, which prohibit the usage of this technique.
The requirement is to remove these limitations.
In our environment we have to cast a lot of timestamp variables, because we don't use the orginal generated timestamp. We modify it, because it is used as a unique clustered key and not to save a time value. To avoid reorg and to spread the rows over the whole tablespace we modity the timestamps, means e.g. we move the last digits (micro-seconds ) to the beginning. Therefore we got artifical timestamps with dates like this: 1582-10-05-126.96.36.199456. When we want to process such a timestamp in Java, DB2 Java classes changes it to 1582-10-15.00.00.00.000000 because the
Gregorian Calendar has timegap between October the 4th and the 15th. To circumvent this we have to cast this values and this is not possible with Batch - mode insert.
Finanz Informatik GmbH & Co. KG