Class
Tree
          
SUMMARY: INNER | FIELD | CONSTR | METHODDETAIL: FIELD | CONSTR | METHOD
 

com.newstep.solid.persistence
Class ConnectionFactory
Direct Known Subclasses:
       DataSourceConnectionFactory, DriverManagerConnectionFactory

public abstract class ConnectionFactory      
Abstract class for ConnectionFactory.

Initialized with its corresponding
com.newstep.solid.persistence.config.ConnectionConfig object, a
ConnectionFactory is responsible for creating/retrieving a Connection object.

The types of ConnectionFactory have been classified into DriverManager based
DriverManagerConnectionFactory or DataSource based ConnectionFactory
DataSourceConnectionFactory
Since:
3.1
Author:
jjohn-chuan
Abstract.
 
 

Method Summary
public static ConnectionFactory
public abstract Connection
getConnection(String username, String password)
public abstract Connection
public abstract void
protected boolean
isEmpty(String str)
Method Detail
createConnectionFactory
public static ConnectionFactory createConnectionFactory (ConnectionConfig config)
 
Static method to create the corresponding ConnectionFactory
It will create the corresponding ConnectionFactory based on the
ConnectionConfig.ConnectionFactoryClassName and initialize the
factory with that configuration.
Parameters:
config -
ConnectionConfiguration.
Return:
an instance of the corresponding ConnectionFactory
Static.
Throws:
PersistenceException
 

getConnection
public abstract Connection getConnection (String username, String password)
 
Need to override getConnection method to provide specific methods to
retrieve/create Connections.
Parameters:
username
password
Return:
Connection object.
Abstract.
Throws:
PersistenceException
 

getConnection
public abstract Connection getConnection ()
 
Need to override getConnection method to provide specific methods to
retrieve/create Connections.
Return:
Connection Object.
Abstract.
Throws:
PersistenceException
 

init
public abstract void init (ConnectionConfig config)
 
Need to override init method to provide specific initialization routines.
Parameters:
config -
ConnectionConfiguration Object.
Abstract.
Throws:
PersistenceException
 

isEmpty
protected boolean isEmpty (String str)
 
Parameters:
str
Return:
boolean str is empty/null
 

Class
Tree
          
SUMMARY: INNER | FIELD | CONSTR | METHODDETAIL: FIELD | CONSTR | METHOD