Package org.apache.derby.jdbc

Examples of org.apache.derby.jdbc.ClientXADataSource


        // Create the proper data source object shell.
        ClientBaseDataSource ds = null;
        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;
        }
View Full Code Here


            (ConnectionPoolDataSource)cpds);
        cpds.setConnectionAttributes(null);
        cpds.setDatabaseName(null);

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

        // XADataSource - connectionAttributes=databaseName=<valid dbname>
        xads.setConnectionAttributes("databaseName=wombat");
        dsConnectionRequests(new String[] 
            {"08001","08001","08001","08001",
             "08001","08001","08001","08001","08001"},
            (XADataSource) xads);
        xads.setConnectionAttributes(null);

        // Test that database name specified in connection attributes is not used
        // XADataSource - databaseName=wombat and
        // connectionAttributes=databaseName=kangaroo
        xads.setConnectionAttributes("databaseName=kangaroo");
        xads.setDatabaseName("wombat");
        dsConnectionRequests(new String[] 
            {"OK","08001","OK","OK","08001","08001","OK","OK","OK"},
            (XADataSource) xads);
        xads.setConnectionAttributes(null);
        xads.setDatabaseName(null);
    } // End testClientDSConnectionAttributes
View Full Code Here

        assertMessageText(cpConn.getConnection(), "true");
        cpds.setConnectionAttributes(null);
        cpConn.close();

        // now with XADataSource
        ClientXADataSource xads = new ClientXADataSource();
        //XADataSource - retrieveMessageTextProperty
        xads.setPortNumber(TestConfiguration.getCurrent().getPort());
        xads.setDatabaseName(dbName);
        xads.setConnectionAttributes(
                retrieveMessageTextProperty + "=false");
        XAConnection xaConn = xads.getXAConnection();
        assertMessageText(xaConn.getConnection(), "false");
        xaConn.close();
        xads.setConnectionAttributes(
                retrieveMessageTextProperty + "=true");
        xaConn = xads.getXAConnection();
        assertMessageText(xaConn.getConnection(), "true");
        xaConn.close();
        xads.setConnectionAttributes(null);
    }
View Full Code Here

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

        // XADataSource - setDescription
        ClientXADataSource xads = new ClientXADataSource();
        xads.setDatabaseName(dbName);
        xads.setDescription(setDescription);
        xads.getConnection();
        getDescription = xads.getDescription();
        assertEquals(setDescription, getDescription);
        xads.setDescription(null);
    }
View Full Code Here

            (ConnectionPoolDataSource)cpds);
        cpds.setConnectionAttributes(null);
        cpds.setDatabaseName(null);

        // now with XADataSource
        ClientXADataSource xads = new ClientXADataSource();
        // XADataSource - EMPTY
        dsConnectionRequests(new String[] 
            {"08001","08001","08001","08001",
             "08001","08001","08001","08001","08001"},
            (XADataSource) xads);

        // XADataSource - connectionAttributes=databaseName=<valid dbname>
        xads.setConnectionAttributes("databaseName=wombat");
        dsConnectionRequests(new String[] 
            {"08001","08001","08001","08001",
             "08001","08001","08001","08001","08001"},
            (XADataSource) xads);
        xads.setConnectionAttributes(null);

        // Test that database name specified in connection attributes is not used
        // XADataSource - databaseName=wombat and
        // connectionAttributes=databaseName=kangaroo
        xads.setConnectionAttributes("databaseName=kangaroo");
        xads.setDatabaseName("wombat");
        dsConnectionRequests(new String[] 
            {"OK","08001","OK","OK","08001","08001","OK","OK","OK"},
            (XADataSource) xads);
        xads.setConnectionAttributes(null);
        xads.setDatabaseName(null);
    } // End testClientDSConnectionAttributes
View Full Code Here

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

        // now with XADataSource
        ClientXADataSource xads = new ClientXADataSource();
        xads.setDatabaseName(dbName);

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

        traceFile = "trace6.out";
        xads.setTraceFile(traceFile);
        xads.getConnection();
        xads.setTraceFile(null);
        xads.setDatabaseName(null);

        assertTraceFilesExist();
    }
View Full Code Here

        assertMessageText(conn,"true");
        cpds.setConnectionAttributes(null);
        conn.close();

        // now with XADataSource
        ClientXADataSource xads = new ClientXADataSource();
        //XADataSource - retrieveMessageTextProperty
        xads.setDatabaseName(dbName);
        xads.setConnectionAttributes(
                retrieveMessageTextProperty + "=false");
        conn = xads.getConnection();
        assertMessageText(conn,"false");
        conn.close();
        xads.setConnectionAttributes(
                retrieveMessageTextProperty + "=true");
        conn = xads.getConnection();
        assertMessageText(conn,"true");
        conn.close();
        xads.setConnectionAttributes(null);
    }
View Full Code Here

        assertMessageText(conn,"true");
        cpds.setConnectionAttributes(null);
        conn.close();

        // now with XADataSource
        ClientXADataSource xads = new ClientXADataSource();
        //XADataSource - retrieveMessageTextProperty
        xads.setDatabaseName(dbName);
        xads.setConnectionAttributes(
                retrieveMessageTextProperty + "=false");
        conn = xads.getConnection();
        assertMessageText(conn,"false");
        conn.close();
        xads.setConnectionAttributes(
                retrieveMessageTextProperty + "=true");
        conn = xads.getConnection();
        assertMessageText(conn,"true");
        conn.close();
        xads.setConnectionAttributes(null);
    }
View Full Code Here

            (ConnectionPoolDataSource)cpds);
        cpds.setConnectionAttributes(null);
        cpds.setDatabaseName(null);

        // now with XADataSource
        ClientXADataSource xads = new ClientXADataSource();
        // XADataSource - EMPTY
        dsConnectionRequests(new String[] 
            {"08001","08001","08001","08001",
             "08001","08001","08001","08001","08001"},
            (XADataSource) xads);

        // XADataSource - connectionAttributes=databaseName=<valid dbname>
        xads.setConnectionAttributes("databaseName=wombat");
        dsConnectionRequests(new String[] 
            {"08001","08001","08001","08001",
             "08001","08001","08001","08001","08001"},
            (XADataSource) xads);
        xads.setConnectionAttributes(null);

        // Test that database name specified in connection attributes is not used
        // XADataSource - databaseName=wombat and
        // connectionAttributes=databaseName=kangaroo
        xads.setConnectionAttributes("databaseName=kangaroo");
        xads.setDatabaseName("wombat");
        dsConnectionRequests(new String[] 
            {"OK","08001","OK","OK","08001","08001","OK","OK","OK"},
            (XADataSource) xads);
        xads.setConnectionAttributes(null);
        xads.setDatabaseName(null);
    } // End testClientDSConnectionAttributes
View Full Code Here

            (ConnectionPoolDataSource)cpds);
        cpds.setConnectionAttributes(null);
        cpds.setDatabaseName(null);

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

        // XADataSource - connectionAttributes=databaseName=<valid dbname>
        xads.setConnectionAttributes("databaseName=wombat");
        dsConnectionRequests(new String[] 
            {"08001","08001","08001","08001",
             "08001","08001","08001","08001","08001"},
            (XADataSource) xads);
        xads.setConnectionAttributes(null);

        // Test that database name specified in connection attributes is not used
        // XADataSource - databaseName=wombat and
        // connectionAttributes=databaseName=kangaroo
        xads.setConnectionAttributes("databaseName=kangaroo");
        xads.setDatabaseName("wombat");
        dsConnectionRequests(new String[] 
            {"OK","08001","OK","OK","08001","08001","OK","OK","OK"},
            (XADataSource) xads);
        xads.setConnectionAttributes(null);
        xads.setDatabaseName(null);
    } // End testClientDSConnectionAttributes
View Full Code Here

TOP

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

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.