nl.knowledgeplaza.util.jdbc
Class Driver

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

public class Driver
extends Object
implements 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 String PREFIX
           
static String SOURCECODE_VERSION
          Standard variable for determining version of a class file.
 
Constructor Summary
Driver()
           
 
Method Summary
 boolean acceptsURL(String url)
           
 Connection connect(String url, Properties info)
           
 int getMajorVersion()
           
 int getMinorVersion()
           
 DriverPropertyInfo[] getPropertyInfo(String url, Properties info)
           
 boolean jdbcCompliant()
           
static void main(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 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 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 Connection connect(String url,
                          Properties info)
                   throws SQLException
Specified by:
connect in interface Driver
Throws:
SQLException

acceptsURL

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

getPropertyInfo

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

getMajorVersion

public int getMajorVersion()
Specified by:
getMajorVersion in interface Driver

getMinorVersion

public int getMinorVersion()
Specified by:
getMinorVersion in interface Driver

jdbcCompliant

public boolean jdbcCompliant()
Specified by:
jdbcCompliant in interface Driver

main

public static void main(String[] args)


Copyright © 2011 KnowledgePlaza. All Rights Reserved.