org.logicalcobwebs.dbscript
Interface ConnectionAdapterIF

All Known Implementing Classes:
ProxoolAdapter, SimpoolAdapter

public interface ConnectionAdapterIF

An interface that will provide connections. It differs from a real Driver because it has setup(java.lang.String, java.lang.String, java.util.Properties) and tearDown() methods.

Since:
Proxool 0.5
Version:
$Revision: 1.8 $, $Date: 2003/03/03 11:12:03 $
Author:
Bill Horsman (bill@logicalcobwebs.co.uk), $Author: billhorsman $ (current maintainer)

Method Summary
 void closeConnection(java.sql.Connection connection)
          This gives the adapter the flexibilty of closing the connection for real or just putting it back in a pool.
 java.sql.Connection getConnection()
          Simply get a connection (using the definitions defined in setup(java.lang.String, java.lang.String, java.util.Properties)
 java.lang.String getName()
          Convenient name so we can identify this adapter in logs.
 void setup(java.lang.String driver, java.lang.String url, java.util.Properties info)
          Setup the adapter.
 void tearDown()
          Reclaim resources used by the adapter (for instance, close any open connections)
 

Method Detail

setup

void setup(java.lang.String driver,
           java.lang.String url,
           java.util.Properties info)
           throws java.sql.SQLException,
                  ProxoolException
Setup the adapter. Define the connection. Prototype any connections as necessary.

Parameters:
driver - the name of the class
url - the url to pass to the driver
info - the properties to pass to the driver
Throws:
java.sql.SQLException - if anything goes wrong
ProxoolException

getConnection

java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Simply get a connection (using the definitions defined in setup(java.lang.String, java.lang.String, java.util.Properties)

Returns:
the connection
Throws:
java.sql.SQLException - if anything goes wrong

closeConnection

void closeConnection(java.sql.Connection connection)
                     throws java.sql.SQLException
This gives the adapter the flexibilty of closing the connection for real or just putting it back in a pool.

Parameters:
connection - the connection to "close"
Throws:
java.sql.SQLException - if anything goes wrong

tearDown

void tearDown()
              throws ProxoolException
Reclaim resources used by the adapter (for instance, close any open connections)

Throws:
ProxoolException

getName

java.lang.String getName()
Convenient name so we can identify this adapter in logs.

Returns:
name