handling exceptions

Extensibility

handling exceptions

I am inserting into teradata using JDBC driver for teradata. In order to process invalid data I am trying to catch the error the executeBatch method in the driver gives. See below-

11/09/28 13:10:39 INFO mapred.JobClient: Task Id : attempt_201109221551_12394_r_000000_0, Status : FAILED

java.lang.NullPointerException

        at com.teradata.jdbc.jdbc_3.ifjdbc_4.TeraLocalPreparedStatement.executeBatch(TeraLocalPreparedStatement.java:292)

        at org.apache.hadoop.mapreduce.lib.db.DBOutputFormat$DBRecordWriter.close(DBOutputFormat.java:89)

Can you suggest how can I do this? In particular when I put a wrong type of data in a field of the PreparedStatement I would like to catch the exception - which should be a SQLException. It seems that exception does not get caught until the executeBatch at the driver level

1 REPLY
Teradata Employee

Re: handling exceptions

You appear to be using an old version of the Teradata JDBC Driver.

We recommend that you upgrade to the newest version of the Teradata JDBC Driver available here on Developer Exchange.

http://downloads.teradata.com/download/connectivity/jdbc-driver