Package javax.sql

Examples of javax.sql.PooledConnection.addConnectionEventListener()


    if (!recycledConnections.isEmpty()) {
      pconn = recycledConnections.remove();
    } else {
      pconn = dataSource.getPooledConnection();
      pconn.addConnectionEventListener(poolConnectionEventListener);
    }

    Connection conn;
    try {
      // The JDBC driver may call ConnectionEventListener.connectionErrorOccurred()
View Full Code Here


      checkToString(dsp);
 

    PooledConnection pc = dsp.getPooledConnection();
    SecurityCheck.inspect(pc, "javax.sql.PooledConnection");
    pc.addConnectionEventListener(new EventCatcher(1));

    checkConnection("ConnectionPoolDataSource", pc.getConnection());
    checkConnection("ConnectionPoolDataSource", pc.getConnection());

    // BUG 4471 - check outstanding updates are rolled back.
View Full Code Here

      ds = dssimple;
      checkConnection("EmbeddedSimpleDataSource", dssimple.getConnection());
    }
   
    pc = dsp.getPooledConnection();
    pc.addConnectionEventListener(new EventCatcher(2));
    checkConnection("ConnectionPoolDataSource", pc.getConnection());
    checkConnection("ConnectionPoolDataSource", pc.getConnection());

    // test "local" XAConnections
    xac = dsx.getXAConnection();
View Full Code Here

        if (usingEmbedded())
        {
            SecurityCheck.assertSourceSecurity(
                pc, "javax.sql.PooledConnection");
        }
        pc.addConnectionEventListener(new AssertEventCatcher(1));

        // DERBY-2531
        // with Network Server / DerbyNetClient, the assertConnectionOK check
        // returns a different connection object...
        assertConnectionOK(
View Full Code Here

        xac.addConnectionEventListener(new AssertEventCatcher(3));
        assertConnectionOK(
            expectedValues, "XADataSource", xac.getConnection());

        pc = dsp.getPooledConnection();
        pc.addConnectionEventListener(new AssertEventCatcher(2));
        assertConnectionOK(
            expectedValues, "ConnectionPoolDataSource", pc.getConnection());

        // test "local" XAConnections
        xac = dsx.getXAConnection();
View Full Code Here

    protected PooledConnection newPooledConnection(String userName, String password)
            throws SQLException {
        PooledConnection connection = (userName != null) ? poolDataSource
                .getPooledConnection(userName, password) : poolDataSource
                .getPooledConnection();
        connection.addConnectionEventListener(this);
        return connection;
    }

    /**
     * Closes all existing connections, removes them from the pool.
View Full Code Here

    PooledConnection pconn;
    if (!recycledConnections.isEmpty()) {
      pconn = recycledConnections.remove();
    } else {
      pconn = dataSource.getPooledConnection();
      pconn.addConnectionEventListener(poolConnectionEventListener);
    }
    Connection conn = pconn.getConnection();
    activeConnections++;
    assertInnerState();
    return conn;
View Full Code Here

    if (testConnectionToString)
      checkToString(dsp);
 

    PooledConnection pc = dsp.getPooledConnection();
    pc.addConnectionEventListener(new EventCatcher(1));

    checkConnection("ConnectionPoolDataSource", pc.getConnection());
    checkConnection("ConnectionPoolDataSource", pc.getConnection());

    // BUG 4471 - check outstanding updates are rolled back.
View Full Code Here

      ds = dssimple;
      checkConnection("EmbeddedSimpleDataSource", dssimple.getConnection());
    }
   
    pc = dsp.getPooledConnection();
    pc.addConnectionEventListener(new EventCatcher(2));
    checkConnection("ConnectionPoolDataSource", pc.getConnection());
    checkConnection("ConnectionPoolDataSource", pc.getConnection());

    // test "local" XAConnections
    xac = dsx.getXAConnection();
View Full Code Here

       
        ConnectionPoolDataSource ds = J2EEDataSource.getConnectionPoolDataSource();

        PooledConnection pc = ds.getPooledConnection();
        //Add a connection event listener to ConnectionPoolDataSource
        pc.addConnectionEventListener(aes12);
        Connection conn = pc.getConnection();
       
        dropTable(conn, "TAB1");

        //No event should have been generated at this point
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.