org.dbunit
Class JdbcDatabaseTester

java.lang.Object
  extended by org.dbunit.assertion.SimpleAssert
      extended by org.dbunit.AbstractDatabaseTester
          extended by org.dbunit.JdbcDatabaseTester
All Implemented Interfaces:
IDatabaseTester
Direct Known Subclasses:
PropertiesBasedJdbcDatabaseTester

public class JdbcDatabaseTester
extends AbstractDatabaseTester

DatabaseTester that uses JDBC's Driver Manager to create connections.

Since:
2.2
Version:
$Revision: 928 $
Author:
Andres Almiray (aalmiray@users.sourceforge.net), Felipe Leme (dbunit@felipeal.net)

Constructor Summary
JdbcDatabaseTester(String driverClass, String connectionUrl)
          Creates a new JdbcDatabaseTester with the specified properties.
Username and Password are set to null.
JdbcDatabaseTester(String driverClass, String connectionUrl, String username, String password)
          Creates a new JdbcDatabaseTester with the specified properties.
JdbcDatabaseTester(String driverClass, String connectionUrl, String username, String password, String schema)
          Creates a new JdbcDatabaseTester with the specified properties.
 
Method Summary
 IDatabaseConnection getConnection()
          Returns the test database connection.
 String toString()
           
 
Methods inherited from class org.dbunit.AbstractDatabaseTester
closeConnection, getDataSet, getSchema, getSetUpOperation, getTearDownOperation, onSetup, onTearDown, setDataSet, setOperationListener, setSchema, setSetUpOperation, setTearDownOperation
 
Methods inherited from class org.dbunit.assertion.SimpleAssert
assertNotNull, assertNotNull, assertNotNullNorEmpty, assertTrue, assertTrue, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JdbcDatabaseTester

public JdbcDatabaseTester(String driverClass,
                          String connectionUrl)
                   throws ClassNotFoundException
Creates a new JdbcDatabaseTester with the specified properties.
Username and Password are set to null.

Parameters:
driverClass - the classname of the JDBC driver to use
connectionUrl - the connection url
Throws:
ClassNotFoundException - If the given driverClass was not found

JdbcDatabaseTester

public JdbcDatabaseTester(String driverClass,
                          String connectionUrl,
                          String username,
                          String password)
                   throws ClassNotFoundException
Creates a new JdbcDatabaseTester with the specified properties.

Parameters:
driverClass - the classname of the JDBC driver to use
connectionUrl - the connection url
username - a username that can has access to the database
password - the user's password
Throws:
ClassNotFoundException - If the given driverClass was not found

JdbcDatabaseTester

public JdbcDatabaseTester(String driverClass,
                          String connectionUrl,
                          String username,
                          String password,
                          String schema)
                   throws ClassNotFoundException
Creates a new JdbcDatabaseTester with the specified properties.

Parameters:
driverClass - the classname of the JDBC driver to use
connectionUrl - the connection url
username - a username that can has access to the database - can be null
password - the user's password - can be null
schema - the database schema to be tested - can be null
Throws:
ClassNotFoundException - If the given driverClass was not found
Since:
2.4.3
Method Detail

getConnection

public IDatabaseConnection getConnection()
                                  throws Exception
Description copied from interface: IDatabaseTester
Returns the test database connection.

Throws:
Exception

toString

public String toString()
Overrides:
toString in class AbstractDatabaseTester


Copyright © 2002-2012. All Rights Reserved.