If a deadlock or slowdown error occurs, the issued SQL statement might be the cause of the error. Therefore, the output of the issued SQL statement to the log makes the error cause analysis easy. The SQL information output to the log is called the SQL statement for troubleshooting.
The SQL statement for troubleshooting is output at the following times:
The SQL statement for troubleshooting is output to the resource adapter operation log and the trace based performance analysis.
With the resource adapter operation log, the SQL statement for troubleshooting is output to the KDJE50080-W message. For details, see KDJE50080-W in the uCosminexus Application Server Messages.
With the trace based performance analysis, the SQL statement for troubleshooting is output to the event ID 0x8C41. For details, see 8. Trace Collection Points and PRF Trace Collection Levels of the Trace Based Performance Analysis in the uCosminexus Application Server Maintenance and Migration Guide.
If the SQL statement is issued in the connection for output, the physical connection stores the SQL statement. This SQL statement stored by the physical connection is output as the SQL statement for troubleshooting.
Table 3-60 List of APIs storing the SQL statement
Interface | Method |
---|---|
java.sql.Connection | prepareCall(String sql) |
prepareCall(String sql, int resultSetType, int resultSetConcurrency) | |
prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) | |
prepareStatement(String sql) | |
prepareStatement(String sql, int autoGeneratedKeys) | |
prepareStatement(String sql, int[] columnIndexes) | |
prepareStatement(String sql, int resultSetType, int resultSetConcurrency) | |
prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) | |
prepareStatement(String sql, String[] columnNames) | |
java.sql.Statement | addBatch(String sql) |
execute(String sql) | |
execute(String sql, int autoGeneratedKeys) | |
execute(String sql, int[] columnIndexes) | |
execute(String sql, String[] columnNames) | |
executeBatch()#1 | |
executeQuery(String sql) | |
executeUpdate(String sql) | |
executeUpdate(String sql, int autoGeneratedKeys) | |
executeUpdate(String sql, int[] columnIndexes) | |
executeUpdate(String sql, String[] columnNames) | |
java.sql.PreparedStatement | Display target method inherited from java.sql.Statement |
addBatch()#2 | |
execute()#2 | |
executeQuery()#2 | |
executeUpdate()#2 | |
java.sql.CallableStatement | Display target method inherited from java.sql.PreparedStatement |
#1: When you execute the executeBatch() method, the SQL statement finally added with the addBatch(String sql) method and addBatch() method is stored in the physical connection.
#2: When you execute the addBatch() method, execute() method, executeQuery() method, and executeUpdate() method, the SQL statement given by the arguments of the prepareStatement method and prepareCall method of java.sql.Connection is stored in the physical connection. However, the IN parameter place holder ("?") of the SQL statement is output as "?" without being substituted.
The notes on the functionality to output the SQL statement for troubleshooting are as follows: