org.apache.openjpa.jdbc.schema
public class DataSourceFactory extends java.lang.Object
DataSourceFactory.DefaultsDataSource
objects. The factory uses the supplied
configuration to obtain a 3rd-party datasource or to create one, and
to setup prepared statement caching.Modifier and Type | Class and Description |
---|---|
protected static class |
DataSourceFactory.DefaultsDataSource
A data source with pre-configured default user name and password.
|
Constructor and Description |
---|
DataSourceFactory() |
Modifier and Type | Method and Description |
---|---|
static void |
closeDataSource(javax.sql.DataSource ds)
Close the given data source.
|
static DecoratingDataSource |
decorateDataSource(javax.sql.DataSource ds,
JDBCConfiguration conf,
boolean factory2)
Install listeners and base decorators.
|
static javax.sql.DataSource |
defaultsDataSource(javax.sql.DataSource ds,
java.lang.String user,
java.lang.String pass)
Return a data source with the given user name and password
pre-configured as the defaults when
DataSourceFactory.DefaultsDataSource.getConnection()
is called. |
static DecoratingDataSource |
installDBDictionary(DBDictionary dict,
DecoratingDataSource ds,
JDBCConfiguration conf,
boolean factory2)
Install things deferred until the DBDictionary instance is available.
|
static javax.sql.DataSource |
newDataSource(JDBCConfiguration conf,
boolean factory2)
Create a datasource using the given configuration.
|
protected static Localizer _eloc
public static javax.sql.DataSource newDataSource(JDBCConfiguration conf, boolean factory2)
public static DecoratingDataSource decorateDataSource(javax.sql.DataSource ds, JDBCConfiguration conf, boolean factory2)
public static DecoratingDataSource installDBDictionary(DBDictionary dict, DecoratingDataSource ds, JDBCConfiguration conf, boolean factory2)
public static javax.sql.DataSource defaultsDataSource(javax.sql.DataSource ds, java.lang.String user, java.lang.String pass)
DataSourceFactory.DefaultsDataSource.getConnection()
is called.public static void closeDataSource(javax.sql.DataSource ds)