nl.knowledgeplaza.util.jdbc
Class Driver

java.lang.Object
  extended by nl.knowledgeplaza.util.jdbc.Driver
All Implemented Interfaces:
java.sql.Driver

public class Driver
extends java.lang.Object
implements java.sql.Driver

This is for logging SQL statements to log4j. URL is jdbc:log4j:[log4j-class|[prefix|]]driverclass#actualURL for example: jdbc:log4j:oracle.jdbc.driver.OracleDriver#jdbc:oracle:thin:@localhost:1521:ORCL or: jdbc:log4j:com.my.class|oracle.jdbc.driver.OracleDriver#jdbc:oracle:thin:@localhost:1521:ORCL or: jdbc:log4j:com.my.class|myPrefix|oracle.jdbc.driver.OracleDriver#jdbc:oracle:thin:@localhost:1521:ORCL

Version:
$Revision: 1.2 $

Field Summary
static org.apache.log4j.Logger log4j
           
static java.lang.String PREFIX
           
static java.lang.String SOURCECODE_VERSION
          Standard variable for determining version of a class file.
 
Constructor Summary
Driver()
           
 
Method Summary
 boolean acceptsURL(java.lang.String url)
           
 java.sql.Connection connect(java.lang.String url, java.util.Properties info)
           
 int getMajorVersion()
           
 int getMinorVersion()
           
 java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url, java.util.Properties info)
           
 boolean jdbcCompliant()
           
static void main(java.lang.String[] args)
           
static void register()
          Register the Driver with DriverManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOURCECODE_VERSION

public static final java.lang.String SOURCECODE_VERSION
Standard variable for determining version of a class file.

See Also:
Constant Field Values

log4j

public static org.apache.log4j.Logger log4j

PREFIX

public static final java.lang.String PREFIX
See Also:
Constant Field Values
Constructor Detail

Driver

public Driver()
Method Detail

register

public static void register()
Register the Driver with DriverManager


connect

public java.sql.Connection connect(java.lang.String url,
                                   java.util.Properties info)
                            throws java.sql.SQLException
Specified by:
connect in interface java.sql.Driver
Throws:
java.sql.SQLException

acceptsURL

public boolean acceptsURL(java.lang.String url)
                   throws java.sql.SQLException
Specified by:
acceptsURL in interface java.sql.Driver
Throws:
java.sql.SQLException

getPropertyInfo

public java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url,
                                                     java.util.Properties info)
                                              throws java.sql.SQLException
Specified by:
getPropertyInfo in interface java.sql.Driver
Throws:
java.sql.SQLException

getMajorVersion

public int getMajorVersion()
Specified by:
getMajorVersion in interface java.sql.Driver

getMinorVersion

public int getMinorVersion()
Specified by:
getMinorVersion in interface java.sql.Driver

jdbcCompliant

public boolean jdbcCompliant()
Specified by:
jdbcCompliant in interface java.sql.Driver

main

public static void main(java.lang.String[] args)


Copyright © 2010 KnowledgePlaza. All Rights Reserved.