org.dbunit.database
Class DatabaseDataSourceConnection

java.lang.Object
  extended by org.dbunit.database.AbstractDatabaseConnection
      extended by org.dbunit.database.DatabaseDataSourceConnection
All Implemented Interfaces:
IDatabaseConnection

public class DatabaseDataSourceConnection
extends AbstractDatabaseConnection
implements IDatabaseConnection

This class adapts a JDBC DataSource to a IDatabaseConnection.

Since:
Mar 8, 2002
Version:
$Revision: 1188 $
Author:
Manuel Laflamme

Constructor Summary
DatabaseDataSourceConnection(DataSource dataSource)
           
DatabaseDataSourceConnection(DataSource dataSource, String schema)
           
DatabaseDataSourceConnection(DataSource dataSource, String user, String password)
           
DatabaseDataSourceConnection(DataSource dataSource, String schema, String user, String password)
           
DatabaseDataSourceConnection(InitialContext context, String jndiName)
           
DatabaseDataSourceConnection(InitialContext context, String jndiName, String schema)
           
DatabaseDataSourceConnection(InitialContext context, String jndiName, String user, String password)
           
DatabaseDataSourceConnection(InitialContext context, String jndiName, String schema, String user, String password)
           
 
Method Summary
 void close()
          Close this connection.
 Connection getConnection()
          Returns a JDBC database connection.
 String getSchema()
          Returns the database schema name.
 
Methods inherited from class org.dbunit.database.AbstractDatabaseConnection
createDataSet, createDataSet, createQueryTable, createTable, createTable, getConfig, getRowCount, getRowCount, getStatementFactory, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.dbunit.database.IDatabaseConnection
createDataSet, createDataSet, createQueryTable, createTable, createTable, getConfig, getRowCount, getRowCount, getStatementFactory
 

Constructor Detail

DatabaseDataSourceConnection

public DatabaseDataSourceConnection(InitialContext context,
                                    String jndiName,
                                    String schema)
                             throws NamingException,
                                    SQLException
Throws:
NamingException
SQLException

DatabaseDataSourceConnection

public DatabaseDataSourceConnection(InitialContext context,
                                    String jndiName,
                                    String schema,
                                    String user,
                                    String password)
                             throws NamingException,
                                    SQLException
Throws:
NamingException
SQLException

DatabaseDataSourceConnection

public DatabaseDataSourceConnection(InitialContext context,
                                    String jndiName)
                             throws NamingException,
                                    SQLException
Throws:
NamingException
SQLException

DatabaseDataSourceConnection

public DatabaseDataSourceConnection(InitialContext context,
                                    String jndiName,
                                    String user,
                                    String password)
                             throws NamingException,
                                    SQLException
Throws:
NamingException
SQLException

DatabaseDataSourceConnection

public DatabaseDataSourceConnection(DataSource dataSource)
                             throws SQLException
Throws:
SQLException

DatabaseDataSourceConnection

public DatabaseDataSourceConnection(DataSource dataSource,
                                    String user,
                                    String password)
                             throws SQLException
Throws:
SQLException

DatabaseDataSourceConnection

public DatabaseDataSourceConnection(DataSource dataSource,
                                    String schema)
                             throws SQLException
Throws:
SQLException

DatabaseDataSourceConnection

public DatabaseDataSourceConnection(DataSource dataSource,
                                    String schema,
                                    String user,
                                    String password)
                             throws SQLException
Throws:
SQLException
Method Detail

getConnection

public Connection getConnection()
                         throws SQLException
Description copied from interface: IDatabaseConnection
Returns a JDBC database connection.

Specified by:
getConnection in interface IDatabaseConnection
Throws:
SQLException

getSchema

public String getSchema()
Description copied from interface: IDatabaseConnection
Returns the database schema name.

Specified by:
getSchema in interface IDatabaseConnection

close

public void close()
           throws SQLException
Description copied from interface: IDatabaseConnection
Close this connection.

Specified by:
close in interface IDatabaseConnection
Throws:
SQLException


Copyright © 2002-2012. All Rights Reserved.