Package com.bryghts.kissdata.bites

Examples of com.bryghts.kissdata.bites.ConfigBite


  private BoneCP connectionPool = null;

  public void init(IStoreConfig configInterface) throws ConfigBite
  {
    if(!(configInterface instanceof JdbcConfig))
      throw new ConfigBite("Configuration instance is not a JdbcConfig");

    config = (JdbcConfig) configInterface;

    try
    {
      Class.forName(config.getDriverClassName());
    }
    catch (ClassNotFoundException e)
    {
      throw new ConfigBite("Driver not found", e);
    }

    BoneCPConfig bcpConfig = new BoneCPConfig();

    bcpConfig.setJdbcUrl(config.getConnectionString());
    bcpConfig.setUsername(config.getUsername());
    bcpConfig.setPassword(config.getPassword());
    bcpConfig.setMinConnectionsPerPartition(5);
    bcpConfig.setMaxConnectionsPerPartition(10);
    bcpConfig.setPartitionCount(1);

    try
    {
      connectionPool = new BoneCP(bcpConfig);
    }
    catch (SQLException e)
    {
      throw new ConfigBite("Could not create the ConnectionPool");
    }
  }
View Full Code Here

TOP

Related Classes of com.bryghts.kissdata.bites.ConfigBite

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.