The driver is able to display debug traces for each JDBC statement called.
This can be done using the system property 'ldbc.trace'.
|off (default)||Debug traces are switched off.|
|on||Each JDBC method call is displayed on System.out, excluding ResultSet and PreparedStatement.setXXX calls. Parameters for the method calls are listed as well. SQLExceptions are listed. SQL statements are listed (the original statement, as well as the vendor specific SQL statement after the conversion).|
|detailed||In addition to the 'on' setting, all ResultSet and PreparedStatement calls are listed. The result for each call is listed as well.|
Logging to file
By default, the log stream is System.out, however a file can be specified:
The log stream is appended to this file. The file is created if it does
not yet exist
How to set the debug trace option
The debug trace can be from the command prompt or in the JDBC url, using
Examples for the command line:
java -Dldbc.trace=detail com.acme.App
java -Dldbc.trace=on,log.txt com.acme.App
Example database URLs:
Most JDBC API methods are implemented, however there are still some
The following classes are fully implemented:
Not yet implemented are:
- All methods that are not part of PreparedStatement
Stored Procedures are very different across databases. Using native stored procedures is not a solution. The proposed solution is: The callable statement calls a client side Java method. The SQL Statement:
Results in to the Java code:
A more advanced solution would be to store the bytecode of the class ADD_CUSTOMER
in the database, and map procedure names to specific Java methods.
It is possible that an application need to access the vendor specific JDBC
driver objects directly, for example for testing, or if a feature is not
yet implemented in LDBC. For such cases, the method getVendorObject is
implemented in Connection, Statement, PreparedStatement, ResultSet, ResultSetMetaData
and DatabaseMetaData. Of course, this method should only be used if the
problem can not be solved using the regular LDBC objects.