Class DataSourceFactory


  • public class DataSourceFactory
    extends java.lang.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
    • Constructor Detail

      • DataSourceFactory

        public DataSourceFactory()
    • Method Detail

      • newDataSource

        public static javax.sql.DataSource newDataSource​(JDBCConfiguration conf,
                                                         boolean factory2)
        Create a datasource using the given configuration.
      • decorateDataSource

        public static DecoratingDataSource decorateDataSource​(javax.sql.DataSource ds,
                                                              JDBCConfiguration conf,
                                                              boolean factory2)
        Install listeners and base decorators.
      • defaultsDataSource

        public 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 DataSource.getConnection() is called.
      • closeDataSource

        public static void closeDataSource​(javax.sql.DataSource ds)
        Close the given data source.