Package org.apache.derby.jdbc

Examples of org.apache.derby.jdbc.ClientConnectionPoolDataSource


        if (ref.getClassName().equals(ClientDataSource.className__)) {
            ds = new ClientDataSource();
        } else if (ref.getClassName().equals(ClientXADataSource.className__)) {
            ds = new ClientXADataSource();
        } else if (ref.getClassName().equals(ClientConnectionPoolDataSource.className__)) {
            ds = new ClientConnectionPoolDataSource();
        } else {
            return null;
        }

        // Fill in the data source object shell with values from the jndi reference.
View Full Code Here


    public void testClientDSConnectionAttributes() throws SQLException {
        if (usingEmbedded())
            return;

        // now with ConnectionPoolDataSource
        ClientConnectionPoolDataSource cpds =
            new ClientConnectionPoolDataSource();
        cpds.setPortNumber(TestConfiguration.getCurrent().getPort());
       
        // ConnectionPoolDataSource - EMPTY
        dsConnectionRequests(new String[] 
            {"08001","08001","08001","08001",
             "08001","08001","08001","08001","08001"},
            (ConnectionPoolDataSource)cpds);

        // ConnectionPoolDataSource
        // - connectionAttributes=databaseName=<valid dbname>
        cpds.setConnectionAttributes("databaseName=" + dbName);
        dsConnectionRequests(new String[] 
            {"08001","08001","08001","08001",
             "08001","08001","08001","08001","08001"},
            (ConnectionPoolDataSource)cpds);
        cpds.setConnectionAttributes(null);

        // Test that database name specified in connection attributes is
        // not used
        // ConnectionPoolDataSource - databaseName=wombat and
        // connectionAttributes=databaseName=kangaroo
        cpds.setConnectionAttributes("databaseName=kangaroo");
        cpds.setDatabaseName(dbName);
        dsConnectionRequests(new String[] 
            {"OK","08001","OK","OK","08001","08001","OK","OK","OK"},
            (ConnectionPoolDataSource)cpds);
        cpds.setConnectionAttributes(null);
        cpds.setDatabaseName(null);

        // now with XADataSource
        ClientXADataSource xads = new ClientXADataSource();
       
        xads.setPortNumber(TestConfiguration.getCurrent().getPort());
View Full Code Here

    public void testClientMessageTextConnectionAttribute() throws SQLException
    {
        String retrieveMessageTextProperty = "retrieveMessageText";
        // with ConnectionPoolDataSource
        // ConnectionPoolDataSource - retrieveMessageTextProperty
        ClientConnectionPoolDataSource cpds = new ClientConnectionPoolDataSource();
        cpds.setPortNumber(TestConfiguration.getCurrent().getPort());
       
        cpds.setDatabaseName(dbName);
        cpds.setConnectionAttributes(
                retrieveMessageTextProperty + "=false");
        PooledConnection cpConn = cpds.getPooledConnection();
        assertMessageText(cpConn.getConnection(), "false");
        cpConn.close();
        cpds.setConnectionAttributes(
                retrieveMessageTextProperty + "=true");
        cpConn = cpds.getPooledConnection();
        assertMessageText(cpConn.getConnection(), "true");
        cpds.setConnectionAttributes(null);
        cpConn.close();

        // now with XADataSource
        ClientXADataSource xads = new ClientXADataSource();
        //XADataSource - retrieveMessageTextProperty
View Full Code Here

        {
          ds = new EmbeddedConnectionPoolDataSource();
            ((EmbeddedConnectionPoolDataSource)ds).setDatabaseName(dbName);
        } else
        {
            ds = new ClientConnectionPoolDataSource();
            ((ClientConnectionPoolDataSource)ds).setDatabaseName(dbName);
        }
        pc = ds.getPooledConnection();
        //Add a connection event listener to ConnectionPoolDataSource
        pc.addConnectionEventListener(aes12);
View Full Code Here

             "08001","08001","OK","OK","OK"}, ds);
        ds.setConnectionAttributes(null);
        ds.setDatabaseName(null);

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

        // ConnectionPoolDataSource
        // - connectionAttributes=databaseName=<valid dbname>
        cpds.setConnectionAttributes("databaseName=" + dbName);
        dsConnectionRequests(new String[] 
            {"08001","08001","08001","08001",
             "08001","08001","08001","08001","08001"},
            (ConnectionPoolDataSource)cpds);
        cpds.setConnectionAttributes(null);

        // Test that database name specified in connection attributes is
        // not used
        // ConnectionPoolDataSource - databaseName=wombat and
        // connectionAttributes=databaseName=kangaroo
        cpds.setConnectionAttributes("databaseName=kangaroo");
        cpds.setDatabaseName(dbName);
        dsConnectionRequests(new String[] 
            {"OK","08001","OK","OK","08001","08001","OK","OK","OK"},
            (ConnectionPoolDataSource)cpds);
        cpds.setConnectionAttributes(null);
        cpds.setDatabaseName(null);

        // now with XADataSource
        ClientXADataSource xads = new ClientXADataSource();
        // XADataSource - EMPTY
        dsConnectionRequests(new String[] 
View Full Code Here

        ds.getConnection();
        ds.setTraceFile(null);
        ds.setDatabaseName(null);

        // now with ConnectionPoolDataSource
        ClientConnectionPoolDataSource cpds = new ClientConnectionPoolDataSource();
        cpds.setDatabaseName(dbName);

        traceFile = "trace3.out";
        cpds.setConnectionAttributes("traceFile="+traceFile);
        // DERBY-2468 - trace3.out does not get created
        cpds.getConnection();
        cpds.setConnectionAttributes(null);

        traceFile = "trace4.out";
        cpds.setTraceFile(traceFile);
        cpds.getConnection();
        cpds.setTraceFile(null);
        cpds.setDatabaseName(null);

        // now with XADataSource
        ClientXADataSource xads = new ClientXADataSource();
        xads.setDatabaseName(dbName);
View Full Code Here

        ds.setConnectionAttributes(null);
        conn.close();

        // now with ConnectionPoolDataSource
        // ConnectionPoolDataSource - retrieveMessageTextProperty
        ClientConnectionPoolDataSource cpds = new ClientConnectionPoolDataSource();
        cpds.setDatabaseName(dbName);
        cpds.setConnectionAttributes(
                retrieveMessageTextProperty + "=false");
        conn = cpds.getConnection();
        assertMessageText(conn,"false");
        conn.close();
        cpds.setConnectionAttributes(
                retrieveMessageTextProperty + "=true");
        conn = cpds.getConnection();
        assertMessageText(conn,"true");
        cpds.setConnectionAttributes(null);
        conn.close();

        // now with XADataSource
        ClientXADataSource xads = new ClientXADataSource();
        //XADataSource - retrieveMessageTextProperty
View Full Code Here

        getDescription = ds.getDescription();
        assertEquals(setDescription, getDescription);
        ds.setDescription(null);

        // ConnectionPoolDataSource - setDescription
        ClientConnectionPoolDataSource cpds =
            new ClientConnectionPoolDataSource();
        cpds.setDatabaseName(dbName);
        cpds.setDescription(setDescription);
        cpds.getConnection();
        getDescription = cpds.getDescription();
        assertEquals(setDescription, getDescription);
        cpds.setDescription(null);

        // XADataSource - setDescription
        ClientXADataSource xads = new ClientXADataSource();
        xads.setDatabaseName(dbName);
        xads.setDescription(setDescription);
View Full Code Here

        {
          ds = new EmbeddedConnectionPoolDataSource();
            ((EmbeddedConnectionPoolDataSource)ds).setDatabaseName(dbName);
        } else
        {
            ds = new ClientConnectionPoolDataSource();
            ((ClientConnectionPoolDataSource)ds).setDatabaseName(dbName);
        }
        pc = ds.getPooledConnection();
        //Add a connection event listener to ConnectionPoolDataSource
        pc.addConnectionEventListener(aes12);
View Full Code Here

    public void testClientDSConnectionAttributes() throws SQLException {
        if (usingEmbedded())
            return;

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

        // ConnectionPoolDataSource
        // - connectionAttributes=databaseName=<valid dbname>
        cpds.setConnectionAttributes("databaseName=" + dbName);
        dsConnectionRequests(new String[] 
            {"08001","08001","08001","08001",
             "08001","08001","08001","08001","08001"},
            (ConnectionPoolDataSource)cpds);
        cpds.setConnectionAttributes(null);

        // Test that database name specified in connection attributes is
        // not used
        // ConnectionPoolDataSource - databaseName=wombat and
        // connectionAttributes=databaseName=kangaroo
        cpds.setConnectionAttributes("databaseName=kangaroo");
        cpds.setDatabaseName(dbName);
        dsConnectionRequests(new String[] 
            {"OK","08001","OK","OK","08001","08001","OK","OK","OK"},
            (ConnectionPoolDataSource)cpds);
        cpds.setConnectionAttributes(null);
        cpds.setDatabaseName(null);

        // now with XADataSource
        ClientXADataSource xads = new ClientXADataSource();
        // XADataSource - EMPTY
        dsConnectionRequests(new String[] 
View Full Code Here

TOP

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

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.