public final class DataSourceConnectionFactory extends AbstractConnectionFactory
GENERIC_ENGINE| Constructor and Description |
|---|
DataSourceConnectionFactory(JdoConf jdoConf,
int index,
Mapping mapping)
Constructs a new DataSourceConnectionFactory with given database and mapping.
|
DataSourceConnectionFactory(java.lang.String name,
java.lang.String engine,
javax.sql.DataSource datasource,
Mapping mapping,
javax.transaction.TransactionManager txManager)
Constructs a new DataSourceConnectionFactory with given name, engine, mapping
and datasource.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
buildMethodName(java.lang.String name)
Build the name of the method to set the parameter value of the given name.
|
java.sql.Connection |
createConnection()
Creates a new JDBC Connection instance.
|
protected void |
initializeFactory()
Initialize the concrete factory.
|
static javax.sql.DataSource |
loadDataSource(Database database,
java.lang.ClassLoader loader)
Initialize JDBC DataSource instance with the given database configuration
instances and the given class loader.
|
static void |
setParameters(javax.sql.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.
|
getDatabase, getEngine, getMapping, getName, getTransactionManager, initializepublic DataSourceConnectionFactory(java.lang.String name,
java.lang.String engine,
javax.sql.DataSource datasource,
Mapping mapping,
javax.transaction.TransactionManager txManager)
throws MappingException
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.MappingException - If LockEngine could not be initialized.public DataSourceConnectionFactory(JdoConf jdoConf, int index, Mapping mapping)
jdoConf - An in-memory jdo configuration.index - Index of the database configuration inside the jdo configuration.mapping - The mapping to load.public static javax.sql.DataSource loadDataSource(Database database, java.lang.ClassLoader loader) throws MappingException
database - Database configuration.loader - ClassLoader to use.MappingException - Problem related to analysing the JDO configuration.public static void setParameters(javax.sql.DataSource dataSource,
Param[] params)
throws MappingException
dataSource - The datasource to set the parameters on.params - The parameters to set on the datasource.MappingException - If one of the parameters could not be set.public static java.lang.String buildMethodName(java.lang.String name)
name - The name of the parameter.protected void initializeFactory()
throws MappingException
initializeFactory in class AbstractConnectionFactoryMappingException - If concrete factory could not be initialized.AbstractConnectionFactory.initializeFactory()public java.sql.Connection createConnection()
throws java.sql.SQLException
java.sql.SQLException - If the JDBC connection cannot be created.ConnectionFactory.createConnection()Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com