Package org.apache.commons.dbcp.datasources

Examples of org.apache.commons.dbcp.datasources.PerUserPoolDataSource


            adapterCPDS.setPoolPreparedStatements(dataSourceInformation.isPoolPreparedStatements());
            adapterCPDS.setMaxIdle(dataSourceInformation.getMaxIdle());


            PerUserPoolDataSource perUserPoolDataSource = new PerUserPoolDataSource();
            perUserPoolDataSource.setConnectionPoolDataSource(adapterCPDS);

            perUserPoolDataSource.setDefaultMaxActive(dataSourceInformation.getMaxActive());
            perUserPoolDataSource.setDefaultMaxIdle(dataSourceInformation.getMaxIdle());
            perUserPoolDataSource.setDefaultMaxWait((int) dataSourceInformation.getMaxWait());
            perUserPoolDataSource.setDefaultAutoCommit(dataSourceInformation.isDefaultAutoCommit());
            perUserPoolDataSource.setDefaultReadOnly(dataSourceInformation.isDefaultReadOnly());
            perUserPoolDataSource.setTestOnBorrow(dataSourceInformation.isTestOnBorrow());
            perUserPoolDataSource.setTestOnReturn(dataSourceInformation.isTestOnReturn());
            perUserPoolDataSource.setTestWhileIdle(dataSourceInformation.isTestWhileIdle());
            perUserPoolDataSource.setMinEvictableIdleTimeMillis(
                    (int) dataSourceInformation.getMinEvictableIdleTimeMillis());
            perUserPoolDataSource.setTimeBetweenEvictionRunsMillis(
                    (int) dataSourceInformation.getTimeBetweenEvictionRunsMillis());
            perUserPoolDataSource.setNumTestsPerEvictionRun(
                    dataSourceInformation.getNumTestsPerEvictionRun());

            if (defaultTransactionIsolation != -1) {
                perUserPoolDataSource.setDefaultTransactionIsolation(defaultTransactionIsolation);
            }


            String validationQuery = dataSourceInformation.getValidationQuery();

            if (validationQuery != null && !"".equals(validationQuery)) {
                perUserPoolDataSource.setValidationQuery(validationQuery);
            }

            return perUserPoolDataSource;

        } else {
View Full Code Here


    public void initialize(Configuration configuration) throws TorqueException
    {
        super.initialize(configuration);

        ConnectionPoolDataSource cpds = initCPDS(configuration);
        PerUserPoolDataSource ds = initJdbc2Pool(configuration);
        ds.setConnectionPoolDataSource(cpds);
        this.ds = ds;
    }
View Full Code Here

     */
    private PerUserPoolDataSource initJdbc2Pool(Configuration configuration)
        throws TorqueException
    {
        log.debug("Starting initJdbc2Pool");
        PerUserPoolDataSource ds = new PerUserPoolDataSource();
        Configuration c = Torque.getConfiguration();

        if (c == null || c.isEmpty())
        {
            log.warn("Global Configuration not set,"
View Full Code Here

                "Torque cannot be initialized without a valid configuration. "
                + "Please check the log files for further details.");
        }

        ConnectionPoolDataSource cpds = initCPDS(configuration);
        PerUserPoolDataSource ds = initJdbc2Pool(configuration);
        ds.setConnectionPoolDataSource(cpds);
        this.ds = ds;
    }
View Full Code Here

     */
    private PerUserPoolDataSource initJdbc2Pool(Configuration configuration)
        throws TorqueException
    {
        log.debug("Starting initJdbc2Pool");
        PerUserPoolDataSource ds = new PerUserPoolDataSource();
        Configuration c = Torque.getConfiguration();

        if (c == null)
        {
            log.warn("Global Configuration not set,"
View Full Code Here

    public void initialize(Configuration configuration) throws TorqueException
    {
        super.initialize(configuration);

        ConnectionPoolDataSource cpds = initCPDS(configuration);
        PerUserPoolDataSource ds = initJdbc2Pool(configuration);
        ds.setConnectionPoolDataSource(cpds);
        this.ds = ds;
    }
View Full Code Here

     */
    private PerUserPoolDataSource initJdbc2Pool(Configuration configuration)
        throws TorqueException
    {
        log.debug("Starting initJdbc2Pool");
        PerUserPoolDataSource ds = new PerUserPoolDataSource();
        Configuration c = Torque.getConfiguration();

        if (c == null || c.isEmpty())
        {
            log.warn("Global Configuration not set,"
View Full Code Here

                "Torque cannot be initialized without a valid configuration. "
                + "Please check the log files for further details.");
        }

        ConnectionPoolDataSource cpds = initCPDS(configuration);
        PerUserPoolDataSource ds = initJdbc2Pool(configuration);
        ds.setConnectionPoolDataSource(cpds);
        this.ds = ds;
    }
View Full Code Here

     */
    private PerUserPoolDataSource initJdbc2Pool(Configuration configuration)
        throws TorqueException
    {
        log.debug("Starting initJdbc2Pool");
        PerUserPoolDataSource ds = new PerUserPoolDataSource();
        Configuration c = Torque.getConfiguration();

        if (c == null)
        {
            log.warn("Global Configuration not set,"
View Full Code Here

     * Test PerUserPoolDataSource bind and lookup
     *
     * @throws Exception
     */
    public void testPerUserPoolDataSourceBind() throws Exception {
        PerUserPoolDataSource dataSource = new PerUserPoolDataSource();
        checkBind(dataSource);     
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.dbcp.datasources.PerUserPoolDataSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.