net.sourceforge.sqlunit.test.mock
Class SQLUnitMockDriver

java.lang.Object
  extended by com.mockrunner.mock.jdbc.MockDriver
      extended by net.sourceforge.sqlunit.test.mock.SQLUnitMockDriver
All Implemented Interfaces:
java.sql.Driver

public class SQLUnitMockDriver
extends com.mockrunner.mock.jdbc.MockDriver

Implements a Mock JDBC driver for SQLUnit.

Version:
$Revision: 1.2 $
Author:
Sujit Pal (spal@users.sourceforge.net)

Constructor Summary
SQLUnitMockDriver()
          Instantiate a SQLUnitMockDriver.
 
Method Summary
 boolean acceptsURL(java.lang.String url)
          Specifies a database URL pattern that this Driver will accept.
 java.sql.Connection connect(java.lang.String url, java.util.Properties info)
          Called from the DriverManager.getConnection() method.
 
Methods inherited from class com.mockrunner.mock.jdbc.MockDriver
getMajorVersion, getMinorVersion, getPropertyInfo, jdbcCompliant, setupConnection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLUnitMockDriver

public SQLUnitMockDriver()
Instantiate a SQLUnitMockDriver.

Method Detail

acceptsURL

public boolean acceptsURL(java.lang.String url)
                   throws java.sql.SQLException
Specifies a database URL pattern that this Driver will accept.

Specified by:
acceptsURL in interface java.sql.Driver
Overrides:
acceptsURL in class com.mockrunner.mock.jdbc.MockDriver
Parameters:
url - the database URL.
Returns:
true if this driver accepts this database URL.
Throws:
java.sql.SQLException - if there is a problem in the method.

connect

public java.sql.Connection connect(java.lang.String url,
                                   java.util.Properties info)
                            throws java.sql.SQLException
Called from the DriverManager.getConnection() method.

Specified by:
connect in interface java.sql.Driver
Overrides:
connect in class com.mockrunner.mock.jdbc.MockDriver
Parameters:
url - the database url to use.
info - a Properties object containing other information.
Returns:
a Connection.
Throws:
java.sql.SQLException - if there was a problem connecting.