net.sourceforge.sqlunit
Class SQLUnitDriverManager

java.lang.Object
  extended by net.sourceforge.sqlunit.SQLUnitDriverManager

public final class SQLUnitDriverManager
extends java.lang.Object

The SQLUnitDriverManager is an incomplete implementation the java.sql.DriverManager class. This class is used to get a Connection object where the JAR file for the database driver is not in the CLASSPATH but in a location specified by a URL. The only methods implemented are the getConnection() methods, with additional arguments specifying the driver class name and the location of the JAR file for the driver.

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

Method Summary
static java.sql.Connection getConnection(java.lang.String url, java.util.Properties props, java.lang.String driverClass, java.lang.String locs)
          Gets the Connection given the JDBC URL, a Properties object containing connection information such as user/password, the class name of the JDBC driver, and the URL location for the JAR file containing the JDBC driver.
static java.sql.Connection getConnection(java.lang.String url, java.lang.String driverClass, java.lang.String locs)
          Gets a Connection given the JDBC URL, the class name of the driver and the URL location where the JAR file for the driver can be found.
static java.sql.Connection getConnection(java.lang.String url, java.lang.String user, java.lang.String password, java.lang.String driverClass, java.lang.String locs)
          Gets a Connection given the JDBC URL, the user/password for the database user, the class name of the driver, and the URL location for the JAR file containing the JDBC driver.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getConnection

public static java.sql.Connection getConnection(java.lang.String url,
                                                java.lang.String driverClass,
                                                java.lang.String locs)
                                         throws java.lang.Exception
Gets a Connection given the JDBC URL, the class name of the driver and the URL location where the JAR file for the driver can be found.

Parameters:
url - the JDBC URL of the driver.
driverClass - the full class name of the JDBC driver.
locs - a comma-separated list of URL strings indicating JAR files and class file directories where the driver class file may be found.
Returns:
a Connection object.
Throws:
java.lang.Exception - if there was a problem getting Connection.

getConnection

public static java.sql.Connection getConnection(java.lang.String url,
                                                java.lang.String user,
                                                java.lang.String password,
                                                java.lang.String driverClass,
                                                java.lang.String locs)
                                         throws java.lang.Exception
Gets a Connection given the JDBC URL, the user/password for the database user, the class name of the driver, and the URL location for the JAR file containing the JDBC driver.

Parameters:
url - the JDBC URL of the driver.
user - the database username.
password - the password for the database user.
driverClass - the full class name of the JDBC driver.
locs - a comma-separated list of URL strings indicating JAR files and class file directories where the driver class file may be found.
Returns:
a Connection object.
Throws:
java.lang.Exception - if there was a problem getting Connection.

getConnection

public static java.sql.Connection getConnection(java.lang.String url,
                                                java.util.Properties props,
                                                java.lang.String driverClass,
                                                java.lang.String locs)
                                         throws java.lang.Exception
Gets the Connection given the JDBC URL, a Properties object containing connection information such as user/password, the class name of the JDBC driver, and the URL location for the JAR file containing the JDBC driver.

Parameters:
url - the JDBC URL of the driver.
props - a Properties object containing connection information.
driverClass - the full class name of the JDBC driver.
locs - a comma-separated list of URL strings indicating JAR files and class file directories where the driver class file may be found.
Returns:
a Connection object.
Throws:
java.lang.Exception - if there was a problem getting Connection.