org.apache.ojb.broker.accesslayer
Class ConnectionFactoryNotPooledImpl

java.lang.Object
  extended by org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl
      extended by org.apache.ojb.broker.accesslayer.ConnectionFactoryNotPooledImpl
All Implemented Interfaces:
ConnectionFactory
Direct Known Subclasses:
ConnectionFactoryManagedImpl

public class ConnectionFactoryNotPooledImpl
extends ConnectionFactoryAbstractImpl

Base implementation without connection pooling.

Version:
$Id: ConnectionFactoryNotPooledImpl.java,v 1.1 2007-08-24 22:17:30 ewestfal Exp $
Author:
Armin Waibel

Constructor Summary
ConnectionFactoryNotPooledImpl()
           
 
Method Summary
 Connection checkOutJdbcConnection(JdbcConnectionDescriptor jcd)
          Returns a valid JDBC Connection.
 void releaseJdbcConnection(JdbcConnectionDescriptor jcd, Connection con)
          Releases a Connection after use.
protected  void validateConnection(Connection conn, JdbcConnectionDescriptor jcd)
           
 
Methods inherited from class org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl
getDbURL, getJcdDescription, getJdbcProperties, getJdbcProperties, initializeJdbcConnection, lookupConnection, newConnectionFromDataSource, newConnectionFromDriverManager, releaseAllResources, releaseConnection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionFactoryNotPooledImpl

public ConnectionFactoryNotPooledImpl()
Method Detail

checkOutJdbcConnection

public Connection checkOutJdbcConnection(JdbcConnectionDescriptor jcd)
                                  throws LookupException
Description copied from class: ConnectionFactoryAbstractImpl
Returns a valid JDBC Connection. Implement this method in concrete subclasses. Concrete implementations using Connection pooling are responsible for any validation and pool removal management.

Note: This method is never called for a jdbc-connection-descriptor that uses datasources, OJB only manages connections from DriverManager.

Note: If the concrete implementation does not callback to ConnectionFactoryAbstractImpl.newConnectionFromDriverManager(org.apache.ojb.broker.metadata.JdbcConnectionDescriptor) when creating a new Connection, it must call ConnectionFactoryAbstractImpl.initializeJdbcConnection(java.sql.Connection, org.apache.ojb.broker.metadata.JdbcConnectionDescriptor) so that the platform implementation can peform any RDBMS-specific init tasks for newly created Connection objetcs.

Specified by:
checkOutJdbcConnection in class ConnectionFactoryAbstractImpl
Parameters:
jcd - the connection descriptor for which to return a validated Connection
Returns:
a valid Connection, never null. Specific implementations must guarantee that the connection is not null and that it is valid.
Throws:
LookupException - if a valid Connection could not be obtained

validateConnection

protected void validateConnection(Connection conn,
                                  JdbcConnectionDescriptor jcd)
                           throws LookupException
Throws:
LookupException

releaseJdbcConnection

public void releaseJdbcConnection(JdbcConnectionDescriptor jcd,
                                  Connection con)
                           throws LookupException
Description copied from class: ConnectionFactoryAbstractImpl
Releases a Connection after use. Implement this method in concrete subclasses. Concrete implementations using Connection pooling are responsible for any validation and pool removal management.

Note: This method is never called for a jdbc-connection-descriptor that uses datasources, OJB only manages connections from DriverManager.

Specified by:
releaseJdbcConnection in class ConnectionFactoryAbstractImpl
Parameters:
jcd - the connection descriptor for which the connection was created
con - the connection to release. Callers must guarantee that the passed connection was obtained by calling ConnectionFactoryAbstractImpl.checkOutJdbcConnection(org.apache.ojb.broker.metadata.JdbcConnectionDescriptor).
Throws:
LookupException - if errors occured during release of object. Typically happens if return of object to pool fails in a pooled implementation.


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.