skip to main content
Using the driver : Tracking JDBC calls with DataDirect Spy : Enabling DataDirect Spy : Using data sources
  

Try DataDirect Drivers Now
Using data sources
You can use DataDirect Spy to track JDBC calls made by running an application with JNDI for Naming Databases.
The com.ddtek.jdbcx.oraclesalescloud.OracleSalesCloudDataSource class supports setting a semi-colon-separated list of DataDirect Spy attributes.

Windows example

OracleSalesCloudDataSource sds=new OracleSalesCloudDataSource():
sds.setServerName("mysite.custhelp.com");
sds.setSpyAttributes("log=(file)C:\\temp\\spy.log;logIS=yes;logTName=yes");
Connection conn=sds.getConnection("TEST","secret");
...
Note: If coding a path on Windows to the log file in a Java string, the backslash character (\) must be preceded by the Java escape character, a backslash. For example: log=(file)C:\\temp\\spy.log;logIS=yes;logTName=yes.
Using this example, DataDirect Spy would load the driver and log all JDBC activity to the spy.log file located in the C:\temp directory (log=(file)C:\\temp\\spy.log). In addition to regular JDBC activity, the spy.log file also logs activity on InputStream and Reader objects (logIS=yes). It also includes the name of the current thread (logTName=yes).

UNIX example

OracleSalesCloudDataSource mds = new OracleSalesCloudDataSource();
mds.setServerName("mysite.custhelp.com");
mds.setSpyAttributes("log=(file)/tmp/spy.log;logTName=yes");
Connection conn=mds.getConnection("TEST","secret");
...
Using this example, DataDirect Spy would load the driver and log all JDBC activity to the spy.log file located in the /tmp directory (log=(file)/tmp/spy.log). The spy.log file includes the name of the current thread (logTName=yes).