My code is like this
--------------------
String sql="INSERT INTO EXPORT_LOG EXPL_LUW_ID, EXPL_SEQ, EXPL_STAMP, EXPL_TBLA_ID, EXPL_ROW_KEY, EXPL_EMP_ID,EXPL_ACTION, EXPL_C_FIELD_IDS, EXPL_C_VALUES, EXPL_STATUS, EXPL_P_TBLA_ID, EXPL_P_KEY, EXPL_SOURCE )VALUES (?, ?, TO_DAT(?,'YYYYMMDDHH24MISS'), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
PreparedStatement stmt = null;
Reader reader= null;
try {
stmt = app.getDataConnection().prepareStatement(sql);
stmt.setString(1,expl.getLuwId());
stmt.setInt(2,expl.getSeq());
stmt.setString(3,expl.getStamp());
stmt.setInt(4,expl.getTableId());
stmt.setString(5,expl.getRowKey());
stmt.setInt(6,expl.getEmpId());
stmt.setString(7,expl.getAction().toString());
stmt.setString(8,expl.getChildFieldIds());
if(expl.getChildValues()!=null){
reader=new CharArrayReader(expl.getChildValues().toCharArray());
stmt.setCharacterStream(9, reader, expl.getChildValues().toCharArray().length);
}
else{
stmt.setString(9,expl.getChildValues());
}
stmt.setString(10,expl.getStatus().toString());
stmt.setInt(11,expl.getParentTableId());
stmt.setString(12,expl.getParentKey());
stmt.setString(13,expl.getSource().toString());
stmt.executeUpdate();
} catch(SQLException e){
handleSqlException(e,sql, app);
}
finally {
DbUtils.closeQuietly(stmt);
IOUtils.closeQuietly(reader);
}
}
------------
in the above code, the record is inserting into database, after that it is throwing SQLException, I think this is throwing in finally block.. can you tell me is this possible.
and is there any chaces to get other than SQLException.
-Bala