Package org.apache.derby.jdbc

Examples of org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource40


    return new DataSourceDescriptorStandard(name, "org.apache.derby.jdbc.EmbeddedDriver",
        this.createConnectionURL(databaseName, username, null), username);
  }
 
  public DataSource createDataSource(String databaseName, String username, IPassword password) throws SQLException {
    EmbeddedConnectionPoolDataSource pooled = new EmbeddedConnectionPoolDataSource40();
    pooled.setDatabaseName(databaseName);
    pooled.setUser(username);
    pooled.setPassword(new String(password.getPassword()));
   
    if (!this.isDatabaseExists(databaseName)) {
      pooled.setCreateDatabase("create");
    }
   
    return pooled;
  }
View Full Code Here


    }
  }
 
  DatabaseData setupDerbyDatabase(WorkflowRepository workflowRepository, LoggingStatisticCollector runtimeStatisticsCollector){

    EmbeddedConnectionPoolDataSource40 datasource_default = new EmbeddedConnectionPoolDataSource40();
    datasource_default.setDatabaseName("./build/copperExampleDB;create=true");
   
    try {
      cleanDB(datasource_default);
    } catch (Exception e) {
      throw new RuntimeException(e);
View Full Code Here

  EmbeddedConnectionPoolDataSource40 ds;

  @Before
  public void setUp() throws Exception {
    ds = new EmbeddedConnectionPoolDataSource40();
    ds.setDatabaseName("./build/copperUnitTestDB;create=true");
    DerbyDbDialect.checkAndCreateSchema(ds);
  }
View Full Code Here

public class DerbyMonitoringDbDialectTest extends MonitoringDbDialectTestBase{

  @Override
  void intit() {
    EmbeddedConnectionPoolDataSource40 datasource = new EmbeddedConnectionPoolDataSource40();
    datasource.setDatabaseName("./build/copperExampleDB;create=true");
    this.datasource=datasource;
   
    DerbyMonitoringDbDialect derbyMonitoringDbDialect = new DerbyMonitoringDbDialect(new StandardJavaSerializer(), new DummyPostProcessor(),new BatchingAuditTrail());
    this.monitoringDbDialect = derbyMonitoringDbDialect;
   
    DerbyDbDialect databaseDialect = new DerbyDbDialect();
    databaseDialect.setDataSource(datasource);
    databaseDialect.startup();
    this.databaseDialect = databaseDialect;

    Connection connection = null;
    try {
      connection = datasource.getConnection();
      connection.setAutoCommit(false);
      DerbyCleanDbUtil.dropSchema(connection.getMetaData(), "APP"); // APP = default schema
      DerbyDbDialect.checkAndCreateSchema(datasource);
    } catch (Exception e) {
      throw new RuntimeException(e);
View Full Code Here

     * @return the {@link ConnectionPoolDataSource}
     */
    public static ConnectionPoolDataSource getDataSource(String dbPath,
                                                         boolean memory) {

        EmbeddedConnectionPoolDataSource40 ds =
                new EmbeddedConnectionPoolDataSource40();
        if (memory) {
            ds.setDatabaseName("memory:SyncDB");               
        } else {
            String path = "SyncDB";
            if (dbPath != null) {
                File f = new File(dbPath);
                f = new File(dbPath,"SyncDB");
                path = f.getAbsolutePath();
            }           

            ds.setDatabaseName(path);
        }
        ds.setCreateDatabase("create");
        ds.setUser("floodlight");
        ds.setPassword("floodlight");
        return ds;
    }
View Full Code Here

TOP

Related Classes of org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource40

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.