Package org.apache.derby.jdbc

Examples of org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource


    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


    return ds;
  }

  public javax.sql.ConnectionPoolDataSource getCPDS(String database, String user, String password) {
   
    EmbeddedConnectionPoolDataSource ds = new EmbeddedConnectionPoolDataSource();
    ds.setDatabaseName(database);
    if (user != null) {
      ds.setUser(user);
      ds.setPassword(password);
    }

    return ds;
  }
View Full Code Here

      */
        System.out.println("test will not build without universal driver");
        return passed;
     
      } else {
        EmbeddedConnectionPoolDataSource dscsp = new EmbeddedConnectionPoolDataSource();
        dscsp.setDatabaseName("wombat");
        //dscsp.setConnectionAttributes("unicode=true");
        dsp = dscsp;
      }

      PooledConnection pc = dsp.getPooledConnection();
View Full Code Here

    private DataSource _ds;

    public void setUp() throws Exception {
        super.setUp();
       
        EmbeddedConnectionPoolDataSource ds = new EmbeddedConnectionPoolDataSource();
        ds.setCreateDatabase("create");
        ds.setDatabaseName("ExternalVariableTest");
        _ds = ds;

        _jdbcext = new JdbcExternalVariableModule();
        _jdbcext.registerDataSource("testds", _ds);
        _server.registerExternalVariableEngine(_jdbcext);
View Full Code Here

    private DataSource _ds;

    public void setUp() throws Exception {
        super.setUp();

        EmbeddedConnectionPoolDataSource ds = new EmbeddedConnectionPoolDataSource();
        ds.setCreateDatabase("create");
        ds.setDatabaseName("target/ExternalVariableTest");
        _ds = ds;

        _jdbcext = new JdbcExternalVariableModule();
        _jdbcext.registerDataSource("testds", _ds);
        _server.registerExternalVariableEngine(_jdbcext);
View Full Code Here

      Statement st;
        AssertEventCatcher aes12 = new AssertEventCatcher(12);
        //Get the correct ConnectionPoolDataSource object
        if (usingEmbedded())
        {
          ds = new EmbeddedConnectionPoolDataSource();
            ((EmbeddedConnectionPoolDataSource)ds).setDatabaseName(dbName);
        } else
        {
            ds = new ClientConnectionPoolDataSource();
            ((ClientConnectionPoolDataSource)ds).setDatabaseName(dbName);
View Full Code Here

        ds.setUser(null);
        ds.setPassword(null);
        ds = null;

        // now with ConnectionPoolDataSource
        EmbeddedConnectionPoolDataSource cpds = new EmbeddedConnectionPoolDataSource();
        // ConnectionPoolDataSource - EMPTY
        dsConnectionRequests(new String[] { 
            "XJ004","XJ004","XJ004","XJ004",
            "XJ004","XJ004","XJ004","XJ004","XJ004"},
            (ConnectionPoolDataSource)cpds);

        // ConnectionPoolDataSource -
        // connectionAttributes=databaseName=wombat
        cpds.setConnectionAttributes("databaseName=" + dbName);
        dsConnectionRequests(new String[] { 
            "XJ004","XJ004","XJ004","XJ004",
            "XJ004","XJ004","XJ004","XJ004","XJ004"},
            (ConnectionPoolDataSource)cpds);
        cpds.setConnectionAttributes(null);

        // ConnectionPoolDataSource - attributesAsPassword=true
        cpds.setAttributesAsPassword(true);
        dsConnectionRequests(new String[] { 
            "XJ004","XJ004","XJ004","XJ028",
            "XJ028","XJ004","XJ004","XJ004","XJ004"},
            (ConnectionPoolDataSource)cpds);
        cpds.setAttributesAsPassword(false);
       
        // ensure the DS property password is not treated as a set of
        // attributes.
        // ConnectionPoolDataSource - attributesAsPassword=true,
        //     user=fred, password=databaseName=wombat;password=wilma");
        cpds.setAttributesAsPassword(true);
        cpds.setUser("fred");
        cpds.setPassword("databaseName=" + dbName + ";password=wilma");
        dsConnectionRequests(new String[] { 
            "XJ004","XJ004","XJ004","XJ028",
            "XJ028","XJ004","XJ004","XJ004","XJ004"},
            (ConnectionPoolDataSource)cpds);
        cpds.setAttributesAsPassword(false);
        cpds.setUser(null);
        cpds.setPassword(null);
        cpds = null;

        // now with XADataSource
        EmbeddedXADataSource xads = new EmbeddedXADataSource();
        // XADataSource - EMPTY
View Full Code Here

      Statement st;
        AssertEventCatcher aes12 = new AssertEventCatcher(12);
        //Get the correct ConnectionPoolDataSource object
        if (usingEmbedded())
        {
          ds = new EmbeddedConnectionPoolDataSource();
            ((EmbeddedConnectionPoolDataSource)ds).setDatabaseName(dbName);
        } else
        {
            ds = new ClientConnectionPoolDataSource();
            ((ClientConnectionPoolDataSource)ds).setDatabaseName(dbName);
View Full Code Here

      */
        System.out.println("test will not build without universal driver");
        return passed;
     
      } else {
        EmbeddedConnectionPoolDataSource dscsp = new EmbeddedConnectionPoolDataSource();
        dscsp.setDatabaseName("wombat");
        //dscsp.setConnectionAttributes("unicode=true");
        dsp = dscsp;
      }

      PooledConnection pc = dsp.getPooledConnection();
View Full Code Here

    private DataSource _ds;

    public void setUp() throws Exception {
        super.setUp();
       
        EmbeddedConnectionPoolDataSource ds = new EmbeddedConnectionPoolDataSource();
        ds.setCreateDatabase("create");
        ds.setDatabaseName("target/ExternalVariableTest");
        _ds = ds;

        _jdbcext = new JdbcExternalVariableModule();
        _jdbcext.registerDataSource("testds", _ds);
        _server.registerExternalVariableEngine(_jdbcext);
View Full Code Here

TOP

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

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.