|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.castor.jdo.engine.AbstractConnectionFactory
org.castor.jdo.engine.DataSourceConnectionFactory
Field Summary |
Fields inherited from class org.castor.jdo.engine.AbstractConnectionFactory |
GENERIC_ENGINE |
Constructor Summary | |
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,
TransactionManager txManager)
Constructs a new DataSourceConnectionFactory with given name, engine, mapping and datasource. |
Method Summary | |
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. |
Methods inherited from class org.castor.jdo.engine.AbstractConnectionFactory |
getDatabase, getEngine, getMapping, getName, getTransactionManager, initialize |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DataSourceConnectionFactory(java.lang.String name, java.lang.String engine, javax.sql.DataSource datasource, Mapping mapping, 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.Method Detail |
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
AbstractConnectionFactory
initializeFactory
in class AbstractConnectionFactory
MappingException
- If concrete factory could not be initialized.AbstractConnectionFactory.initializeFactory()
public java.sql.Connection createConnection() throws java.sql.SQLException
ConnectionFactory
java.sql.SQLException
- If the JDBC connection cannot be created.ConnectionFactory.createConnection()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |