org.castor.jdo.engine
Class DataSourceConnectionFactory
- ConnectionFactory
public final class DataSourceConnectionFactory
$Revision: 7327 $ $Date: 2006-04-12 15:13:08 -0600 (Wed, 12 Apr 2006) $
static String | buildMethodName(String name) - Build the name of the method to set the parameter value of the given name.
|
Connection | createConnection() -
|
void | initializeFactory() -
|
static DataSource | loadDataSource(Database database, ClassLoader loader) - Initialize JDBC DataSource instance with the given database configuration
instances and the given class loader.
|
static void | setParameters(DataSource dataSource, Param[] params) - Set all the parameters of the given array at the given datasource by calling
one of the set methods of the datasource.
|
DataSourceConnectionFactory
public DataSourceConnectionFactory(String name,
String engine,
DataSource datasource,
Mapping mapping,
TransactionManager txManager)
throws MappingException
Constructs a new DataSourceConnectionFactory with given name, engine, mapping
and datasource. Factory will be ready to use without calling initialize first.
name
- The Name of the database configuration.engine
- The Name of the persistence factory to use.datasource
- The preconfigured datasource to use for creating connections.mapping
- The previously loaded mapping.txManager
- The transaction manager to use.
DataSourceConnectionFactory
public DataSourceConnectionFactory(JdoConf jdoConf,
int index,
Mapping mapping)
Constructs a new DataSourceConnectionFactory with given database and mapping.
Initialize needs to be called before using the factory to create connections.
jdoConf
- An in-memory jdo configuration.index
- Index of the database configuration inside the jdo configuration.mapping
- The mapping to load.
buildMethodName
public static String buildMethodName(String name)
Build the name of the method to set the parameter value of the given name. The
name of the method is build by preceding given parameter name with 'set' followed
by all letters of the name. In addition the first letter and all letters
following a '-' sign are converted to upper case.
name
- The name of the parameter.
- The name of the method to set the value of this parameter.
loadDataSource
public static DataSource loadDataSource(Database database,
ClassLoader loader)
throws MappingException
Initialize JDBC DataSource instance with the given database configuration
instances and the given class loader.
database
- Database configuration.loader
- ClassLoader to use.
- The initalized DataSource.
setParameters
public static void setParameters(DataSource dataSource,
Param[] params)
throws MappingException
Set all the parameters of the given array at the given datasource by calling
one of the set methods of the datasource.
dataSource
- The datasource to set the parameters on.params
- The parameters to set on the datasource.
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com