com.cafesoft.core.jdbc
Class StandardConnectionProvider

java.lang.Object
  |
  +--com.cafesoft.core.jdbc.StandardConnectionProvider
All Implemented Interfaces:
ConnectionProvider

public class StandardConnectionProvider
extends Object
implements ConnectionProvider

StandardConnectionProvider implements a general ConnectionProvider that utilizes a JDBC DriverManager to instantiate Connection instances.

This class requires the following configuration Properties:

Since:
09/29/04
See Also:
Connection

Constructor Summary
StandardConnectionProvider()
          Create a new StandardConnectionProvider.
 
Method Summary
 void close()
          Close the ConnectionProvider.
 void configure(Properties p)
          Configure the ConnectionProvider.
 void destroy()
          Destroy the ConnectionProvider.
 Connection getConnection()
          Get a Connection.
 void releaseConnection(Connection c)
          Release a Connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardConnectionProvider

public StandardConnectionProvider()
Create a new StandardConnectionProvider.

Method Detail

configure

public void configure(Properties p)
               throws ConfigurationException
Configure the ConnectionProvider.

Specified by:
configure in interface ConnectionProvider
Parameters:
p - configuration Properties.
Throws:
ConfigurationException - if required configuration properties are missing or invalid.

getConnection

public Connection getConnection()
                         throws SQLException
Get a Connection.

NOTE: Clients that get a Connection are required to release it when done.

Specified by:
getConnection in interface ConnectionProvider
Returns:
a Connection.
Throws:
SQLException - if unable to get a Connection.

releaseConnection

public void releaseConnection(Connection c)
Release a Connection.

Specified by:
releaseConnection in interface ConnectionProvider
Parameters:
c - the Connection to be released.

close

public void close()
Close the ConnectionProvider.

NOTE: this method must only be invoked by objects controlling access to the ConnectionProvider.

Specified by:
close in interface ConnectionProvider

destroy

public void destroy()
Destroy the ConnectionProvider.

Specified by:
destroy in interface ConnectionProvider


Generated on 5:16:42 PM May 12, 2008, © 1996-2005 Cafésoft LLC. All rights reserved.