> # Registering the DataDirect Spy™ JDBC Driver

> To use the Spy JDBC Driver, you first must register it with the JDBC Driver Manager. You can register the Spy JDBC Driver in any of the following ways:

> - Method 1: Set the Java property jdbc.drivers using the Java -D option. The jdbc.drivers property is defined as a colon-separated list of driver class names. For example:

> com.ddtek.jdbcspy.SpyDriver:
> com.ddtek.jdbc.sequelink.SequeLinkDriver

> The jdbc.drivers property can be set like other Java properties, using the -D option. For example:

> java -Djdbc.drivers=com.ddtek.jdbcspy.SpyDriver

> - Method 2: Set the Java property jdbc.drivers from within your Java application or applet. To do this, code the following lines in your Java application or applet, and call DriverManager.getConnection():

> Properties p = System.getProperties();

> p.put ("jdbc.drivers", "com.ddtek.jdbcspy.SpyDriver");

> System.setProperties (p);

> - Method 3: Explicitly load the driver class using the standard Class.forName() method. To do this, code the following line and call DriverManager.getConnection():

> Class.forName("com.ddtek.jdbcspy.SpyDriver");

> ### DataDirect Spy™ Attributes

> DataDirect Spy uses the following format as a connection URL:

>     jdbc:spy:{original-url};[key=value]...

> where `original-url` is the connection URL of the underlying JDBC driver.

> In addition, you can specify the following options:

> log=System.out | Redirects logging to the Java output standard, System.out.
> log=(file)filename | Redirects logging to the file specified by filename.
> load=classname | Loads the driver specified by classname. The default value is com.ddtek.sequelink.jdbc. SequeLinkDriver. This attribute is supported only when you enable DataDirect Spy using the DataDirect Spy URL.
> linelimit=numberofchars | The maximum number of characters, specified by numberofchars, that Spy will log on one line. When set to no (the initial default), there is no maximum limit on the number of characters.
> logLobs={yes | no} | Specifies whether Spy logs activity on Blob / Clob. The initial default is no.
> logIS={yes | no | nosingleread} | Specifies whether DataDirect Spy logs activity on InputStreams. When logIS=nosingleread, logging on InputStream and Reader objects is active; however, logging of the single-byte read InputStream.read or single-character Reader.read is suppressed to prevent generating large log files that contain single-byte or single character read messages. When set to no (the initial default), DataDirect Spy does not log activity on InputStreams.
> logTName={yes | no} | Specifies whether DataDirect Spy logs the name of the current thread. When set to no (the initial default), DataDirect Spy does not log the name of the current thread.
> timestamp={yes | no} | Specifies whether a timestamp should be included on each line of the DataDirect Spy log. When set to no (the initial default), DataDirect Spy does not include a timestamp on each line.