Package org.logicalcobwebs.proxool

Examples of org.logicalcobwebs.proxool.ProxoolDataSource


*/
public class ProxoolDataSourceCreator extends AbstractDataSourceCreator {

  @Override
  protected DataSource createDataSource() {
    return new ProxoolDataSource();
  }
View Full Code Here


        }
        System.out.println();
    }

    public void test_proxool() throws Exception {
        ProxoolDataSource dataSource = new ProxoolDataSource();
        // dataSource.(10);
        // dataSource.setMaxActive(50);
        dataSource.setMinimumConnectionCount(minPoolSize);
        dataSource.setMaximumConnectionCount(maxPoolSize);

        dataSource.setDriver(driverClass);
        dataSource.setDriverUrl(jdbcUrl);

        dataSource.setUser(user);
        dataSource.setPassword(password);

        for (int i = 0; i < loopCount; ++i) {
            p0(dataSource, "proxool", threadCount);
        }
        System.out.println();
View Full Code Here

     * and bind it to JNDI using the given jndi properties.
     * @param jndiProperties the jndi related configuration properties.
     * @throws ProxoolException if the JNDI binding failes.
     */
    public static void registerDatasource(String alias, Properties jndiProperties) throws ProxoolException {
        DataSource dataSource = new ProxoolDataSource(alias);
        final String jndiName = jndiProperties.getProperty(ProxoolConstants.JNDI_NAME);
        jndiProperties.remove(ProxoolConstants.JNDI_NAME);
        try {
            InitialContext initalContext = new InitialContext(jndiProperties);
            initalContext.rebind(jndiName, dataSource);
View Full Code Here

            System.out.println("--------------------------------------------");
        }
    }

    public void f_test_proxool() throws Exception {
        ProxoolDataSource ds = new ProxoolDataSource();
        ds.setDriver("com.alibaba.druid.mock.MockDriver");
        ds.setDriverUrl("jdbc:mock:test");
        ds.setMaximumConnectionCount(10);
        ds.setMinimumConnectionCount(0);
        ds.setUser("user");
        ds.setPassword("password");

        for (int i = 0; i < 10; ++i) {
            f(ds, 5);
            System.out.println("--------------------------------------------");
        }
View Full Code Here

            System.out.println("--------------------------------------------");
        }
    }
   
    public void f_test_proxool() throws Exception {
        ProxoolDataSource ds = new ProxoolDataSource();
        ds.setDriver("com.alibaba.druid.mock.MockDriver");
        ds.setDriverUrl("jdbc:mock:test");
        ds.setMaximumConnectionCount(10);
        ds.setMinimumConnectionCount(0);
        ds.setUser("user");
        ds.setPassword("password");
       
        for (int i = 0; i < 10; ++i) {
            f(ds, 5);
            System.out.println("--------------------------------------------");
        }
View Full Code Here

        }
        System.out.println();
    }

    public void test_proxool() throws Exception {
        ProxoolDataSource dataSource = new ProxoolDataSource();
        // dataSource.(10);
        // dataSource.setMaxActive(50);
        dataSource.setMinimumConnectionCount(minPoolSize);
        dataSource.setMaximumConnectionCount(maxPoolSize);

        dataSource.setDriver(driverClass);
        dataSource.setDriverUrl(jdbcUrl);
        // dataSource.setPoolPreparedStatements(true);
        // dataSource.setMaxOpenPreparedStatements(100);
        dataSource.setUser(user);
        dataSource.setPassword(password);

        for (int i = 0; i < loopCount; ++i) {
            p0(dataSource, "proxool", threadCount);
        }
        System.out.println();
View Full Code Here

        }
        System.out.println();
    }
   
    public void f_test_proxool() throws Exception {
        ProxoolDataSource dataSource = new ProxoolDataSource();
        // dataSource.(10);
        // dataSource.setMaxActive(50);
        dataSource.setMinimumConnectionCount(minIdle);
        dataSource.setMaximumConnectionCount(maxIdle);

        dataSource.setDriver(driverClass);
        dataSource.setDriverUrl(jdbcUrl);
        // dataSource.setPoolPreparedStatements(true);
        // dataSource.setMaxOpenPreparedStatements(100);
        dataSource.setUser(user);
        dataSource.setPassword(password);

        for (int i = 0; i < LOOP_COUNT; ++i) {
            p0(dataSource, "proxool");
        }
        System.out.println();
View Full Code Here

     * @throws MetaClientException
     */
    public final static void main(final String[] args) throws MetaClientException {
        final HttpClientConfig httpClientConfig = new HttpClientConfig("localhost", 8080);

        final ProxoolDataSource dataSource = new ProxoolDataSource();
        dataSource.setDriver("com.mysql.jdbc.Driver");
        dataSource.setDriverUrl("jdbc:mysql://localhost:3306/meta");
        dataSource.setUser("root");
        dataSource.setPassword("1234QWER");
        httpClientConfig.setDataSource(dataSource);
        final SimpleHttpConsumer client = new SimpleHttpConsumer(httpClientConfig);
        client.subscribe("meta-test", new Partition(1, 1), 99999, new MessageListener() {

            @Override
View Full Code Here

   * @throws PropertyVetoException
   * @throws InterruptedException
   * @throws SQLException
   */
  private ProxoolDataSource multiThreadedProxool(boolean doPreparedStatement) throws PropertyVetoException, InterruptedException, SQLException {
    ProxoolDataSource cpds = new ProxoolDataSource();
    cpds.setDriver("com.jolbox.bonecp.MockJDBCDriver");

    cpds.setDriverUrl(url);
    cpds.setUser(username);
    cpds.setPassword(password);
    cpds.setMaximumConnectionLifetime(Integer.MAX_VALUE);
    cpds.setMaximumActiveTime(Long.MAX_VALUE);
    cpds.setTestBeforeUse(false);
    cpds.setMinimumConnectionCount(pool_size);
    cpds.setMaximumConnectionCount(pool_size);
    return cpds;
  }
View Full Code Here

TOP

Related Classes of org.logicalcobwebs.proxool.ProxoolDataSource

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.