Package javax.sql

Examples of javax.sql.ConnectionEventListener


      ConnectionEvent errorEvent = new ConnectionEvent(this, exception);

      for (Enumeration e = eventListener.elements();
         e.hasMoreElements(); )
      {
        ConnectionEventListener l =
          (ConnectionEventListener)e.nextElement();
        l.connectionErrorOccurred(errorEvent);
      }
    }
  }
View Full Code Here


      ConnectionEvent closeEvent = new ConnectionEvent(this);

      for (Enumeration e = eventListener.elements();
         e.hasMoreElements(); )
      {
        ConnectionEventListener l =
          (ConnectionEventListener)e.nextElement();
        l.connectionClosed(closeEvent);
      }
    }
  }
View Full Code Here

  /**
   * Tests fix for BUG#7136 ... Statement.getConnection() returning physical
   * connection instead of logical connection.
   */
  public void testBug7136() {
    final ConnectionEventListener conListener = new ConnectionListener();
    PooledConnection pc = null;
    this.closeEventCount = 0;

    try {
      pc = this.cpds.getPooledConnection();
View Full Code Here

  /**
   * Test the nb of closeEvents generated when a Connection is reclaimed. No
   * event should be generated in that case.
   */
  public void testConnectionReclaim() {
    final ConnectionEventListener conListener = new ConnectionListener();
    PooledConnection pc = null;
    final int NB_TESTS = 5;

    try {
      pc = this.cpds.getPooledConnection();
View Full Code Here

   *
   * @throws Exception
   *             if the test fails.
   */
  public void testPacketTooLargeException() throws Exception {
    final ConnectionEventListener conListener = new ConnectionListener();
    PooledConnection pc = null;

    pc = this.cpds.getPooledConnection();

    pc.addConnectionEventListener(conListener);
View Full Code Here

   * Test the nb of closeEvents generated by a PooledConnection. A
   * JDBC-compliant driver should only generate 1 closeEvent each time
   * connection.close() is called.
   */
  public void testCloseEvent() {
    final ConnectionEventListener conListener = new ConnectionListener();
    PooledConnection pc = null;
    final int NB_TESTS = 5;

    try {
      pc = this.cpds.getPooledConnection();
View Full Code Here

    ConnectionEvent connectionevent = new ConnectionEvent(this,
        sqlException);

    while (iterator.hasNext()) {

      ConnectionEventListener connectioneventlistener = iterator.next().getValue();

      if (eventType == CONNECTION_CLOSED_EVENT) {
        connectioneventlistener.connectionClosed(connectionevent);
      } else if (eventType == CONNECTION_ERROR_EVENT) {
        connectioneventlistener
            .connectionErrorOccurred(connectionevent);
      }
    }
  }
View Full Code Here

  /**
   * Tests fix for BUG#7136 ... Statement.getConnection() returning physical
   * connection instead of logical connection.
   */
  public void testBug7136() {
    final ConnectionEventListener conListener = new ConnectionListener();
    PooledConnection pc = null;
    this.closeEventCount = 0;

    try {
      pc = this.cpds.getPooledConnection();
View Full Code Here

  /**
   * Test the nb of closeEvents generated when a Connection is reclaimed. No
   * event should be generated in that case.
   */
  public void testConnectionReclaim() {
    final ConnectionEventListener conListener = new ConnectionListener();
    PooledConnection pc = null;
    final int NB_TESTS = 5;

    try {
      pc = this.cpds.getPooledConnection();
View Full Code Here

   *
   * @throws Exception
   *             if the test fails.
   */
  public void testPacketTooLargeException() throws Exception {
    final ConnectionEventListener conListener = new ConnectionListener();
    PooledConnection pc = null;

    pc = this.cpds.getPooledConnection();

    pc.addConnectionEventListener(conListener);
View Full Code Here

TOP

Related Classes of javax.sql.ConnectionEventListener

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.