Package org.apache.derby.jdbc

Examples of org.apache.derby.jdbc.ClientXADataSourceInterface


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

        // now with XADataSource
        ClientXADataSourceInterface xads;
       
        if (JDBC.vmSupportsJNDI()) {
            xads = (ClientXADataSourceInterface)Class.forName(
                "org.apache.derby.jdbc.ClientXADataSource").
                    newInstance();
        } else {
            xads = (ClientXADataSourceInterface)Class.forName(
                "org.apache.derby.jdbc.BasicClientXADataSource40").
                    newInstance();
        }

        xads.setPortNumber(TestConfiguration.getCurrent().getPort());
       
        // XADataSource - EMPTY
        dsXAConnectionRequests(new String[]
            {"08001","08001","08001","08001",
             "08001","08001","08001","08001","08001"},
            xads);

        // XADataSource - connectionAttributes=databaseName=<valid dbname>
        xads.setConnectionAttributes("databaseName=wombat");
        dsXAConnectionRequests(new String[]
            {"08001","08001","08001","08001",
             "08001","08001","08001","08001","08001"},
            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");
        dsXAConnectionRequests(new String[]
            {"OK","08001","OK","OK","08001","08001","OK","OK","OK"},
            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
        ClientXADataSourceInterface xads;
        if (JDBC.vmSupportsJNDI()) {
            xads = (ClientXADataSourceInterface)Class.forName(
                "org.apache.derby.jdbc.ClientXADataSource").
                    newInstance();
        } else {
            xads = (ClientXADataSourceInterface)Class.forName(
                "org.apache.derby.jdbc.BasicClientXADataSource40").
                    newInstance();
        }
        //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

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

        // now with XADataSource
        ClientXADataSourceInterface xads;
       
        if (JDBC.vmSupportsJNDI()) {
            xads = (ClientXADataSourceInterface)Class.forName(
                "org.apache.derby.jdbc.ClientXADataSource").
                    newInstance();
        } else {
            xads = (ClientXADataSourceInterface)Class.forName(
                "org.apache.derby.jdbc.BasicClientXADataSource40").
                    newInstance();
        }

        xads.setPortNumber(TestConfiguration.getCurrent().getPort());
       
        // XADataSource - EMPTY
        dsXAConnectionRequests(new String[]
            {"08001","08001","08001","08001",
             "08001","08001","08001","08001","08001"},
            xads);

        // XADataSource - connectionAttributes=databaseName=<valid dbname>
        xads.setConnectionAttributes("databaseName=wombat");
        dsXAConnectionRequests(new String[]
            {"08001","08001","08001","08001",
             "08001","08001","08001","08001","08001"},
            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");
        dsXAConnectionRequests(new String[]
            {"OK","08001","OK","OK","08001","08001","OK","OK","OK"},
            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
        ClientXADataSourceInterface xads;
        if (JDBC.vmSupportsJNDI()) {
            xads = (ClientXADataSourceInterface)Class.forName(
                "org.apache.derby.jdbc.ClientXADataSource").
                    newInstance();
        } else {
            xads = (ClientXADataSourceInterface)Class.forName(
                "org.apache.derby.jdbc.BasicClientXADataSource40").
                    newInstance();
        }
        //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

TOP

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

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.