JDBC Type 2 Driver Programmer's Reference for SQL/MX Release 3.2.1 (H06.26+, J06.15+)

Mapping statement-IDs to SQL statements applies to any interface that prepares or executes a
statement, for example, PreparedStatement, Connection, ResultSet, JdbcRowSet,
and Statement.
“Specifying Statement-ID Logging (page 78)
“Properties for Statement-ID Logging (page 78)
“Statement-ID Log Output” (page 79)
Specifying Statement-ID Logging
To specify supplemental logging:
Set the enableLog property to on to enable logging.
Set the idMapFile property to specify the log file. By default, the log is written to the screen.
For additional information about these properties, see enableLog Property” (page 78) and
“idMapFile Property” (page 78).
You can specify these properties either in the command line or in the program similar to setting
tracing described earlier under Tracing Using the java Command and Tracing Using the
system.setProperty Method.
>Specify Logging in the Command Line
java Djdbcmx.idMapFile=logFile Djdbcmx.enableLog=on
Specify Logging in a Program
System.setProperty("enableLog", "on");
System.setProperty("idMapFile", "myMapFile.log");
Properties for Statement-ID Logging
enableLog Property
Enables logging of SQL statement IDs and the corresponding JDBC SQL statements. The format for
enableLog property is:
-Djdbcmx.enableLog=boolean
Data type: boolean
Default: off
Valid values are either on or off. You can specify this property only in the java command line.
The following specification in the java command line enables the logging:
-Djdbcmx.enableLog=on
For more information, see “Logging SQL Statement IDs and Corresponding JDBC SQL Statements
(page 77).
idMapFile Property
Specifies the file to which the JDBC trace facility logs SQL statement IDs and the corresponding
JDBC SQL statements. The format for the idMapFile property is:
-Djdbcmx.idMapFile=filename
Data type: string
Default: logs to the screen
Specify a valid OSS file name. You can specify this property only in the java command line.
The following entry in the java command line specifies logging to file /sales/app5/STMID-Log.
-Djdbcmx.idMapFile=/sales/app5/STMID-log
78 JDBC Trace Facility