Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.openjpa.jdbc.schema
Class DataSourceFactory

    java.lang.Object
      org.apache.openjpa.jdbc.schema.DataSourceFactory

    public class DataSourceFactory

extends Object

Factory for `DataSource` objects. The factory uses the supplied configuration to obtain a 3rd-party datasource or to create one, and to setup prepared statement caching.

Author:
  Abe White

Field Summary
`protected static Localizer` | `_eloc`

Constructor Summary
`DataSourceFactory()`

Method Summary
`static void` | `closeDataSource(DataSource ds)` Close the given data source.
`static DecoratingDataSource` | `decorateDataSource(DataSource ds, JDBCConfiguration conf, boolean factory2)` Install listeners and base decorators.
`static DataSource` | `defaultsDataSource(DataSource ds, String user, String pass)` Return a data source with the given user name and password pre-configured as the defaults when `DataSource.getConnection()` is called.
`static DecoratingDataSource` | `installDBDictionary(DBDictionary dict, DecoratingDataSource ds, JDBCConfiguration conf, boolean factory2)` Install things deferred until the DBDictionary instance is available.
`(package private) static OpenJPAException` | `newConnectException(JDBCConfiguration conf, boolean factory2, Exception cause)`
`static DataSource` | `newDataSource(JDBCConfiguration conf, boolean factory2)` Create a datasource using the given configuration.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### _eloc

    protected static Localizer _eloc

Constructor Detail

### DataSourceFactory

    public DataSourceFactory()

Method Detail

### newDataSource

    public static DataSource newDataSource(JDBCConfiguration conf,
                                           boolean factory2)

  Create a datasource using the given configuration.

### decorateDataSource

    public static DecoratingDataSource decorateDataSource(DataSource ds,
                                                          JDBCConfiguration conf,
                                                          boolean factory2)

  Install listeners and base decorators.

### installDBDictionary

    public static DecoratingDataSource installDBDictionary(DBDictionary dict,
                                                           DecoratingDataSource ds,
                                                           JDBCConfiguration conf,
                                                           boolean factory2)

  Install things deferred until the DBDictionary instance is available.

### newConnectException

    static OpenJPAException newConnectException(JDBCConfiguration conf,
                                                boolean factory2,
                                                Exception cause)

### defaultsDataSource

    public static DataSource defaultsDataSource(DataSource ds,
                                                String user,
                                                String pass)

  Return a data source with the given user name and password pre-configured as the defaults when `DataSource.getConnection()` is called.

### closeDataSource

    public static void closeDataSource(DataSource ds)

  Close the given data source.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006-2013 Apache Software Foundation. All Rights Reserved.