Examples of BoneCPDataSource


Examples of com.jolbox.bonecp.BoneCPDataSource

    @Resource
    private Environment environment;

    @Bean
    public DataSource dataSource() {
        BoneCPDataSource dataSource = new BoneCPDataSource();

        dataSource.setDriverClass(environment.getRequiredProperty(PROPERTY_NAME_DATABASE_DRIVER));
        dataSource.setJdbcUrl(environment.getRequiredProperty(PROPERTY_NAME_DATABASE_URL));
        dataSource.setUsername(environment.getRequiredProperty(PROPERTY_NAME_DATABASE_USERNAME));
        dataSource.setPassword(environment.getRequiredProperty(PROPERTY_NAME_DATABASE_PASSWORD));

        return dataSource;
    }
View Full Code Here

Examples of com.jolbox.bonecp.BoneCPDataSource

    @Resource
    private Environment environment;

    @Bean
    public DataSource dataSource() {
        BoneCPDataSource dataSource = new BoneCPDataSource();

        dataSource.setDriverClass(environment.getRequiredProperty(PROPERTY_NAME_DATABASE_DRIVER));
        dataSource.setJdbcUrl(environment.getRequiredProperty(PROPERTY_NAME_DATABASE_URL));
        dataSource.setUsername(environment.getRequiredProperty(PROPERTY_NAME_DATABASE_USERNAME));
        dataSource.setPassword(environment.getRequiredProperty(PROPERTY_NAME_DATABASE_PASSWORD));

        return dataSource;
    }
View Full Code Here

Examples of com.jolbox.bonecp.BoneCPDataSource

    @Autowired
    private Environment environment;

    @Bean
    public DataSource dataSource() {
        BoneCPDataSource dataSource = new BoneCPDataSource();

        dataSource.setDriverClass(environment.getRequiredProperty(PROPERTY_NAME_DATABASE_DRIVER));
        dataSource.setJdbcUrl(environment.getRequiredProperty(PROPERTY_NAME_DATABASE_URL));
        dataSource.setUsername(environment.getRequiredProperty(PROPERTY_NAME_DATABASE_USERNAME));
        dataSource.setPassword(environment.getRequiredProperty(PROPERTY_NAME_DATABASE_PASSWORD));

        return dataSource;
    }
View Full Code Here

Examples of com.jolbox.bonecp.BoneCPDataSource

    config.setMinConnectionsPerPartition(2);
    config.setPartitionCount(1);
    config.setLazyInit(true);
    config.setUsername("sam");
    config.setPassword("");
    BoneCPDataSource ds = new BoneCPDataSource(config);
    ExecutorService es = Executors.newCachedThreadPool();

    String MYSQL_SCHEMAS = "avro_schemas";
    mab1 = new ShardableMysqlAB(es, ds, "user", "profile", MYSQL_SCHEMAS, User.SCHEMA$, AvroFormat.JSON, KEYTX);
    mab2 = new ShardableMysqlAB(es, ds, "user2", "profile", MYSQL_SCHEMAS, User.SCHEMA$, AvroFormat.JSON, KEYTX);
View Full Code Here

Examples of com.jolbox.bonecp.BoneCPDataSource

    config.setMaxConnectionsPerPartition(50);
    config.setPartitionCount(4);
    config.setLazyInit(true);
    config.setUsername("test");
    config.setPassword("");
    return new BoneCPDataSource(config);
  }
View Full Code Here

Examples of com.jolbox.bonecp.BoneCPDataSource

    config.setMaxConnectionsPerPartition(50);
    config.setPartitionCount(4);
    config.setLazyInit(true);
    config.setUsername("bagcheck");
    config.setPassword("");
    dataSource = new BoneCPDataSource(config);
  }
View Full Code Here

Examples of com.jolbox.bonecp.BoneCPDataSource

    @Resource
    private Environment environment;

    @Bean
    public DataSource dataSource() {
        BoneCPDataSource dataSource = new BoneCPDataSource();

        dataSource.setDriverClass(environment.getRequiredProperty(PROPERTY_NAME_DATABASE_DRIVER));
        dataSource.setJdbcUrl(environment.getRequiredProperty(PROPERTY_NAME_DATABASE_URL));
        dataSource.setUsername(environment.getRequiredProperty(PROPERTY_NAME_DATABASE_USERNAME));
        dataSource.setPassword(environment.getRequiredProperty(PROPERTY_NAME_DATABASE_PASSWORD));

        return dataSource;
    }
View Full Code Here

Examples of com.jolbox.bonecp.BoneCPDataSource

      config.setJdbcUrl(driverUrl);
      config.setMaxConnectionsPerPartition(10);
      config.setPartitionCount(1);
      config.setUser(user);
      config.setPassword(passwd);
      connPool = new BoneCPDataSource(config);
    } else if ("dbcp".equals(connectionPooler)) {
      ObjectPool objectPool = new GenericObjectPool();
      ConnectionFactory connFactory = new DriverManagerConnectionFactory(driverUrl, user, passwd);
      // This doesn't get used, but it's still necessary, see
      // http://svn.apache.org/viewvc/commons/proper/dbcp/branches/DBCP_1_4_x_BRANCH/doc/ManualPoolingDataSourceExample.java?view=markup
View Full Code Here

Examples of com.jolbox.bonecp.BoneCPDataSource

    public CommonDataSource pool(final String name, final String driver, final Properties properties) {
        // bonecp already have a kind of ObjectRecipe so simply giving it the values
        final Properties props = new Properties();
        props.put("properties", prefixedProps(properties));

        final BoneCPDataSource ds = build(BoneCPDataSource.class, props);
        if (ds.getDriverClass() == null || ds.getDriverClass().isEmpty()) {
            ds.setDriverClass(driver);
        }
        if (ds.getPoolName() == null || ds.getPoolName().isEmpty()) {
            ds.setPoolName(name);
        }

        final String xa = String.class.cast(properties.remove("XaDataSource"));
        if (xa != null) {
            cleanProperty(ds, "xadatasource");

            final XADataSource xaDs = XADataSourceResource.proxy(Thread.currentThread().getContextClassLoader(), xa);
            ds.setDatasourceBean(new ManagedXADataSource(xaDs, OpenEJB.getTransactionManager()));
        }

        return ds;
    }
View Full Code Here

Examples of com.jolbox.bonecp.BoneCPDataSource

        _log.warning("Max Connections number is higher then 60.. Using Partition 2 and Connection 30");
        Config.DATABASE_MAX_CONNECTIONS = 50;
        Config.DATABASE_PARTITION_COUNT = 4;
      }
     
      _source = new BoneCPDataSource();
      // _source.setAutoCommitOnClose(true);
      _source.getConfig().setDefaultAutoCommit(true);

      // _source.setInitialPoolSize(10);
      _source.getConfig().setPoolAvailabilityThreshold(10);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.