Package javax.sql

Examples of javax.sql.PooledConnection.addConnectionEventListener()


        assertFalse(aes3.didConnectionErrorEventHappen());
        aes3.resetState();
                      
        pc = dsp.getPooledConnection();
        AssertEventCatcher aes2 = new AssertEventCatcher(2);
        pc.addConnectionEventListener(aes2);
        assertConnectionOK(
            expectedValues, "ConnectionPoolDataSource", pc.getConnection());
        //Check if got connection closed event but not connection error event
        assertTrue(aes2.didConnectionClosedEventHappen());
        assertFalse(aes2.didConnectionErrorEventHappen());
View Full Code Here


                throw new IllegalStateException("Connection pool data source returned null from getPooledConnection");
            }

            // should we add this object as a listener or the pool.
            // consider the validateObject method in decision
            pc.addConnectionEventListener(this);
            pci = new PooledConnectionAndInfo(pc, _username, _password);
            pcMap.put(pc, pci);
        } catch (SQLException e) {
            throw new RuntimeException(e.getMessage());
        }
View Full Code Here

            throw new IllegalStateException("Connection pool data source returned null from getPooledConnection");
        }

        // should we add this object as a listener or the pool.
        // consider the validateObject method in decision
        pc.addConnectionEventListener(this);
        pci = new PooledConnectionAndInfo(pc, username, password);
        pcMap.put(pc, pci);

        return new DefaultPooledObject<>(pci);
    }
View Full Code Here

                throw new IllegalStateException("Connection pool data source returned null from getPooledConnection");
            }

            // should we add this object as a listener or the pool.
            // consider the validateObject method in decision
            pc.addConnectionEventListener(this);
            pci = new PooledConnectionAndInfo(pc, _username, _password);
            pcMap.put(pc, pci);
        } catch (SQLException e) {
            throw new RuntimeException(e.getMessage());
        }
View Full Code Here

            throw new IllegalStateException("Connection pool data source returned null from getPooledConnection");
        }

        // should we add this object as a listener or the pool.
        // consider the validateObject method in decision
        pc.addConnectionEventListener(this);
        pci = new PooledConnectionAndInfo(pc, username, password);
        pcMap.put(pc, pci);

        return new DefaultPooledObject<>(pci);
    }
View Full Code Here

            throw new IllegalStateException("Connection pool data source returned null from getPooledConnection");
        }

        // should we add this object as a listener or the pool.
        // consider the validateObject method in decision
        pc.addConnectionEventListener(this);
        pci = new PooledConnectionAndInfo(pc, username, password);
        pcMap.put(pc, pci);

        return new DefaultPooledObject<>(pci);
    }
View Full Code Here

                throw new IllegalStateException("Connection pool data source returned null from getPooledConnection");
            }

            // should we add this object as a listener or the pool.
            // consider the validateObject method in decision
            pc.addConnectionEventListener(this);
            pci = new PooledConnectionAndInfo(pc, _username, _password);
            pcMap.put(pc, pci);
        } catch (SQLException e) {
            throw new RuntimeException(e.getMessage());
        }
View Full Code Here

    //dscsp.setConnectionAttributes("unicode=true");
    ConnectionPoolDataSource dsp = dscsp;
    checkToString(dsp);

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

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

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

    // and back to EmbeddedSimpleDataSource
    ds = dssimple;
    checkConnection("EmbeddedSimpleDataSource", dssimple.getConnection());
   
    pc = dsp.getPooledConnection();
    pc.addConnectionEventListener(new EventCatcher(2));
    checkConnection("EmbeddedConnectionPoolDataSource", pc.getConnection());
    checkConnection("EmbeddedConnectionPoolDataSource", pc.getConnection());

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

        } else {
            pc = dataSource.getPooledConnection();
        }
        Connection conn = pc.getConnection();
        activeConnections++;
        pc.addConnectionEventListener(this);
        return conn;
    }

    /**
     * This method usually puts the connection back into the pool. There are
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.