Package org.apache.derby.jdbc

Examples of org.apache.derby.jdbc.ClientDataSource


        String sState = "CONNECTED";
        String msg = null;
        Thread.sleep(waitTime); // .... until stable...
        try
        {
            ClientDataSource ds = configureDataSource( fullDbPath, serverHost, serverPort, useEncryption(false) );
            Connection conn = ds.getConnection();
            conn.close();
        }
        catch ( SQLException se )
        {
            errCode = se.getErrorCode();
View Full Code Here


        String msg = null;
        while (true)
        {
            try
            {
                ClientDataSource ds = configureDataSource( fullDbPath, serverHost, serverPort, useEncryption(false) );
                Connection conn = ds.getConnection();
                util.DEBUG("Wait Got connection after "
                        + (count-1) +" * "+ sleepTime + " ms.");
                conn.close();
                return;
            }
View Full Code Here

        String msg = null;
        while (true)
        {
            try
            {
                ClientDataSource ds = configureDataSource( fullDbPath, serverHost, serverPort, useEncryption(false) );
                Connection conn = ds.getConnection();
                // Should never get here!
                conn.close();
                assertTrue("Expected SQLState'"+expectedState
                            + "', but got connection!",
                        false);
View Full Code Here

                     */
                    String  connectionAttributes = "startMaster=true"
                        +";slaveHost="+slaveReplInterface
                        +";slavePort="+slaveReplPort
                        +useEncryption(false);
                    ClientDataSource ds = configureDataSource
                        ( masterDbPath( dbName ), masterHost, masterServerPort, connectionAttributes );
                    conn = ds.getConnection();
                   
                    done = true;
                    conn.close();
                    util.DEBUG("startMaster_direct connected in " + count + " * 100ms.");
                }
View Full Code Here

    SQLException _connectToSlave(String slaveServerHost, int slaveServerPort,
            String dbPath)
        throws SQLException
    {
        util.DEBUG("_connectToSlave");
        ClientDataSource ds = new org.apache.derby.jdbc.ClientDataSource();
        ds.setDatabaseName(dbPath);
        ds.setServerName(slaveServerHost);
        ds.setPortNumber(slaveServerPort);
        ds.setConnectionAttributes(useEncryption(false));
        try {
            Connection conn = ds.getConnection();
            conn.close();
            return null; // If successfull.
        } catch (SQLException se) {
            return se;
        }      
View Full Code Here

                         * using DriverManager.getConnection() concurrently
                         * in startMaster and startSlave!
                        Class.forName(DRIVER_CLASS_NAME); // Needed when running from classes!
                        conn = DriverManager.getConnection(URL);
                         */
                        ClientDataSource ds = configureDataSource( fDbPath, fSlaveHost, fSlaveServerPort, fConnAttrs );
                        conn = ds.getConnection();
                        conn.close();
                    }
                    catch (SQLException se)
                    {
                        startSlaveException = se;
View Full Code Here

                    slaveDbPath( replicatedDb ),
                    simpleLoadTuples);
            // return;
        }

        ClientDataSource ds = configureDataSource
            ( slaveDbPath( replicatedDb ), slaveServerHost, slaveServerPort, useEncryption(false) );
        Connection conn = ds.getConnection();
           
        simpleVerify(conn);
        conn.close();
        /* BEGIN Distributed repl. tests only */
        if ( !slaveServerHost.equalsIgnoreCase("localhost") ){
View Full Code Here

                    masterDbPath( replicatedDb ),
                    simpleLoadTuples);
            // return;
        }

        ClientDataSource ds = configureDataSource
            ( masterDbPath( replicatedDb ), masterServerHost, masterServerPort, useEncryption(false) );
        Connection conn = ds.getConnection();
           
        simpleVerify(conn);
        conn.close();
        /* BEGIN Distributed repl. tests only */
        if ( !masterServerHost.equalsIgnoreCase("localhost") ){
View Full Code Here

            int _noTuplesToInsert)
        throws SQLException
    {
        util.DEBUG("_testInsertUpdateDeleteOnMaster: " + serverHost + ":" +
                   serverPort + "/" + dbPath + " " + _noTuplesToInsert);
        ClientDataSource ds = configureDataSource( dbPath, serverHost, serverPort, useEncryption(false) );
        Connection conn = ds.getConnection();
       
        PreparedStatement ps = conn.prepareStatement("create table t(i integer primary key, s varchar(64))");
       
        ps.execute();
       
View Full Code Here

            String dbPath,
            int _noTuplesInserted)
        throws SQLException
    {
        util.DEBUG("_verifyDatabase: "+serverHost+":"+serverPort+"/"+dbPath);
        ClientDataSource ds = configureDataSource( dbPath, serverHost, serverPort, useEncryption(false) );
        Connection conn = ds.getConnection();
       
        _verify(conn,_noTuplesInserted);
       
        conn.close();
    }
View Full Code Here

TOP

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

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.