org.castor.cpa.persistence.sql.connection
Class DriverConnectionFactory

java.lang.Object
  extended by org.castor.cpa.persistence.sql.connection.DriverConnectionFactory
All Implemented Interfaces:
ConnectionFactory

public final class DriverConnectionFactory
extends Object
implements ConnectionFactory

Since:
0.9.9
Version:
$Revision: 8994 $ $Date: 2011-08-02 01:40:59 +0200 (Di, 02 Aug 2011) $
Author:
Werner Guttmann, Ralf Joachim

Constructor Summary
DriverConnectionFactory(Driver driver, boolean useProxies)
          Constructs a new DriverConnectionFactory with given database and mapping.
 
Method Summary
 CastorConnection createCastorConnection()
          Creates a new CastorConnection instance.
 Connection createConnection()
          Creates a new JDBC Connection instance.
 void initializeFactory(PersistenceFactory factory)
          Initialize the concrete factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DriverConnectionFactory

public DriverConnectionFactory(Driver driver,
                               boolean useProxies)
Constructs a new DriverConnectionFactory with given database and mapping.

Parameters:
driver - Driver configuration.
useProxies - Wrap JDBC connections by proxies?
Method Detail

initializeFactory

public void initializeFactory(PersistenceFactory factory)
                       throws MappingException
Initialize the concrete factory.

Specified by:
initializeFactory in interface ConnectionFactory
Parameters:
factory - PersistenceFactory needed to construct CastorConnection.
Throws:
MappingException - If concrete factory could not be initialized.

createConnection

public Connection createConnection()
                            throws SQLException
Creates a new JDBC Connection instance.

Specified by:
createConnection in interface ConnectionFactory
Returns:
A JDBC Connection.
Throws:
SQLException - If the JDBC connection cannot be created.

createCastorConnection

public CastorConnection createCastorConnection()
                                        throws SQLException
Creates a new CastorConnection instance.

Specified by:
createCastorConnection in interface ConnectionFactory
Returns:
A CastorConnection instance.
Throws:
SQLException - If the CastorConnection cannot be created.


Copyright © 2012. All Rights Reserved.