My program is very simple, jsut one thread. But exception was raised each time ran,
java.sql.BatchUpdateException: [Teradata JDBC Driver] [TeraJDBC 13.00.00.25] [Error 1338] [SQLState HY000] A failure occurred while executing a PreparedStatement batch request. Details of the failure can be found in the exception chain that is accessible with getNextException.
The source code is as below,
mPreparedStatement = mConnection.prepareStatement(sql);
result = true;
int nCount = 0;
if ( null != rs ) //rs is the resultSet from other database
while( rs.next() )
prepareParameters(rs, syncTbl, dbInst);
if (nCount % 100 == 0)
nCount = 0;
if (nCount > 0)
Thanks in advance
Teradata JDBC Driver version 13.00.00.25 is a rather old version. You should consider upgrading to a newer version.
You should modify your application to walk the SQLException chain using the SQLException.getNextException method.
catch (SQLException ex)
for ( ; ex != null ; ex = ex.getNextException ())
ex.printStackTrace () ;
I am using [Teradata JDBC Driver] [TeraJDBC 14.00.00.41] and getting below exception chain :
Sumit, this is a duplicate post, and you should have posted this question as a new forum thread. Please do not "necro" old threads from 3 years ago.
The Teradata JDBC Driver User Guide documents how an application should handle a BatchUpdateException. Here is a link to the relevant section in the documentation: