|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcraftsman.spy.SpyDriver
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");
Constructor Summary | |
SpyDriver()
Constructs a new Spy JDBC driver. |
Method Summary | |
boolean |
acceptsURL(java.lang.String url)
Retrieves whether the real driver thinks that it can open a connection to the given URL. |
java.sql.Connection |
connect(java.lang.String url,
java.util.Properties info)
Attempts to make a database connection to the given URL. |
int |
getMajorVersion()
Retrieves the real driver's major version number. |
int |
getMinorVersion()
Gets the real driver's minor version number. |
java.sql.DriverPropertyInfo[] |
getPropertyInfo(java.lang.String url,
java.util.Properties info)
Gets information about the possible properties for the real driver. |
boolean |
jdbcCompliant()
Reports whether thz real driver is a genuine JDBC Compliant driver. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SpyDriver() throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.sql.SQLException
java.lang.ClassNotFoundException
- When the real JDBC driver class was not found.
java.lang.InstantiationException
- When the real JDBC driver cannot be instancied.
java.lang.IllegalAccessException
- When cannot create a new instance of the real
JDBC driver.
java.sql.SQLException
- When cannot register the Spy JDBC driver or deregistrer
the real JDBC driver.Method Detail |
public int getMajorVersion()
1
.
getMajorVersion
in interface java.sql.Driver
Driver.getMajorVersion()
public int getMinorVersion()
0
.
getMinorVersion
in interface java.sql.Driver
Driver.getMinorVersion()
public boolean jdbcCompliant()
jdbcCompliant
in interface java.sql.Driver
true
if this driver is JDBC Compliant;
false
otherwise.Driver.jdbcCompliant()
public boolean acceptsURL(java.lang.String url) throws java.sql.SQLException
acceptsURL
in interface java.sql.Driver
url
- String The URL of the database
true
if this driver understands
the given URL; false
otherwise.
java.sql.SQLException
- If a database access error occurs.Driver.acceptsURL(java.lang.String)
public java.sql.Connection connect(java.lang.String url, java.util.Properties info) throws java.sql.SQLException
connect
in interface java.sql.Driver
url
- String The URL of the database to which to connect.info
- Properties A list of arbitrary string tag/value
pairs as connection arguments.
java.sql.SQLException
- If a database access error occurs.Driver.connect(java.lang.String, java.util.Properties)
public java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url, java.util.Properties info) throws java.sql.SQLException
getPropertyInfo
in interface java.sql.Driver
url
- String The URL of the database to which to connect.info
- Properties A proposed list of tag/value pairs that will
be sent on connect open.
java.sql.SQLException
- If a database access error occurs.Driver.getPropertyInfo(java.lang.String, java.util.Properties)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |