| |
|
| java.lang.Object craftsman.spy.SpyDriver
SpyDriver | public class SpyDriver implements Driver(Code) | | This classe is the implementation of the JDBC driver in order to
log any JDBC action.
The system property spy.driver MUST contains the real
JDBC driver full class name in order to use the Spy driver.
Another way is to use a specific JDBC url string like :
jdbc:spy:driver_full_class_name:url .
The two solutions can be used as the following examples :
System.setProperty("spy.driver","vendor.database.Driver");// or with the -Dspy.driver=vendor.database.Driver JVM option
Class.forName("craftsman.spy.SpyDriver");
Connection c = DriverManager.getConnection("jdbc:database:mydata");
Class.forName("craftsman.spy.SpyDriver");
Connection c = DriverManager.getConnection("jdbc:spy:vendor.database.Driver:database:mydata");
author: Sébastien LECACHEUR |
Constructor Summary | |
public | SpyDriver() Constructs a new Spy JDBC driver. |
Method Summary | |
public boolean | acceptsURL(String url) Retrieves whether the real driver thinks that it can open a
connection to the given URL. | public Connection | connect(String url, Properties info) Attempts to make a database connection to the given URL.
Parameters: url - String The URL of the database to which to connect. Parameters: info - Properties A list of arbitrary string tag/valuepairs as connection arguments. | public int | getMajorVersion() Retrieves the real driver's major version number. | public int | getMinorVersion() Gets the real driver's minor version number. | public DriverPropertyInfo[] | getPropertyInfo(String url, Properties info) Gets information about the possible properties for the real driver.
Parameters: url - String The URL of the database to which to connect. Parameters: info - Properties A proposed list of tag/value pairs that willbe sent on connect open. | public boolean | jdbcCompliant() Reports whether thz real driver is a genuine JDBC Compliant driver. |
acceptsURL | public boolean acceptsURL(String url) throws SQLException(Code) | | Retrieves whether the real driver thinks that it can open a
connection to the given URL.
Parameters: url - String The URL of the database boolean true if this driver understandsthe given URL; false otherwise. throws: SQLException - If a database access error occurs. See Also: Driver.acceptsURL(java.lang.String) |
getMajorVersion | public int getMajorVersion()(Code) | | Retrieves the real driver's major version number. Initially
this should be 1 .
int This driver's major version number. See Also: Driver.getMajorVersion |
getMinorVersion | public int getMinorVersion()(Code) | | Gets the real driver's minor version number. Initially this
should be 0 .
int This driver's minor version number. See Also: Driver.getMinorVersion |
jdbcCompliant | public boolean jdbcCompliant()(Code) | | Reports whether thz real driver is a genuine JDBC Compliant driver.
boolean true if this driver is JDBC Compliant;false otherwise. See Also: Driver.jdbcCompliant |
|
|
|