org.dbforms.conprovider
Class ConnectionProvider

java.lang.Object
  extended by org.dbforms.conprovider.ConnectionProvider
Direct Known Subclasses:
JakartaConnectionProvider, ProtomatterConnectionProvider, SimpleConnectionProvider, SingleConnectionProvider, SinglePerThreadConnectionProvider

public abstract class ConnectionProvider
extends Object

ConnectionProvider base class.
To create a ConnectionProvider for your preferred ConnectionPooler, extend this class and implement initialize and getConnection methods.

Author:
Luca Fossato

Constructor Summary
ConnectionProvider()
          Constructor for the ConnectionProvider object.
 
Method Summary
protected abstract  Connection getConnection()
          Get a JDBC Connection.
protected  Connection getConnection(int isolationLevel)
          Get a "transactional" JDBC connection.
protected  String getLastToken(String str, String tokenSeparator)
          Get the last token from the input string.
 ConnectionProviderPrefs getPrefs()
          Gets the prefs attribute of the ConnectionProvider object
protected abstract  void init()
          Initialize the connection pool provider.
 void setPrefs(ConnectionProviderPrefs prefs)
          Sets the prefs attribute of the ConnectionProvider object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionProvider

public ConnectionProvider()
                   throws Exception
Constructor for the ConnectionProvider object.

Throws:
Exception - Description of the Exception
Method Detail

setPrefs

public void setPrefs(ConnectionProviderPrefs prefs)
Sets the prefs attribute of the ConnectionProvider object

Parameters:
prefs - The new prefs value

getPrefs

public ConnectionProviderPrefs getPrefs()
Gets the prefs attribute of the ConnectionProvider object

Returns:
The prefs value

getConnection

protected abstract Connection getConnection()
                                     throws SQLException
Get a JDBC Connection.

Returns:
a JDBC Connection
Throws:
SQLException - Description of the Exception

init

protected abstract void init()
                      throws Exception
Initialize the connection pool provider.

Throws:
Exception - Description of the Exception

getConnection

protected Connection getConnection(int isolationLevel)
                            throws SQLException
Get a "transactional" JDBC connection.

Parameters:
isolationLevel - the isolation level to set the connection to
Returns:
the new "transactional" connection object
Throws:
SQLException - if any error occurs

getLastToken

protected String getLastToken(String str,
                              String tokenSeparator)
Get the last token from the input string.

Parameters:
str - the string containing the token
tokenSeparator - the token separator string (i.e.: "'", ":", etc)
Returns:
the last token from the input string


Copyright © 2002-2005 DbForms. All Rights Reserved.