Package weka.gui.sql.event

# Class ConnectionEvent

java.lang.Object
java.util.EventObject
weka.gui.sql.event.ConnectionEvent

All Implemented Interfaces:
  `Serializable`

public class ConnectionEvent extends EventObject
An event that is generated when a connection is established or dropped.

Version:
  $Revision: 8034 $
Author:
  FracPete (fracpete at waikato dot ac dot nz)
See Also:
  - `ConnectionListener`
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `CONNECT`
  it was a connect try
  `static final int`
  `DISCONNECT`
  it was a disconnect

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ConnectionEvent(Object source, int type, DbUtils utils)`
  constructs the event
  `ConnectionEvent(Object source, int type, DbUtils utils, Exception ex)`
  constructs the event

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `failed()`
  whether an exception happened and is stored
  `DbUtils`
  `getDbUtils()`
  returns the DbUtils instance that is responsible for the connect/disconnect.
  `Exception`
  `getException()`
  returns the stored exception, if any (can be NULL)
  `int`
  `getType()`
  returns the type of this event, CONNECT or DISCONNECT
  `boolean`
  `isConnected()`
  returns whether the connection is still open.
  `String`
  `toString()`
  returns the event in a string representation

  ### Methods inherited from class java.util.EventObject

  `getSource`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### CONNECT

    public static final int CONNECT
    it was a connect try
    See Also:
      - Constant Field Values

  - ### DISCONNECT

    public static final int DISCONNECT
    it was a disconnect
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### ConnectionEvent

    public ConnectionEvent(Object source, int type, DbUtils utils)
    constructs the event
    Parameters:
      `source` - the source that generated this event
      `type` - whether CONNECT or DISCONNECT happened
      `utils` - the DatabaseUtils isntance responsible for the connection

  - ### ConnectionEvent

    public ConnectionEvent(Object source, int type, DbUtils utils, Exception ex)
    constructs the event
    Parameters:
      `source` - the source that generated this event
      `type` - whether CONNECT or DISCONNECT happened
      `utils` - the DatabaseUtils isntance responsible for the connection
      `ex` - a possible exception, if not successful

- ## Method Details

  - ### getType

    public int getType()
    returns the type of this event, CONNECT or DISCONNECT
    Returns:
      the type of this event
    See Also:
      - `CONNECT`
      - `DISCONNECT`

  - ### failed

    public boolean failed()
    whether an exception happened and is stored
    Returns:
      whether an exception happened

  - ### isConnected

    public boolean isConnected()
    returns whether the connection is still open.
    Returns:
      whether the connection is still open

  - ### getException

    public Exception getException()
    returns the stored exception, if any (can be NULL)

  - ### getDbUtils

    public DbUtils getDbUtils()
    returns the DbUtils instance that is responsible for the connect/disconnect.
    Returns:
      the responsible DbUtils instance

  - ### toString

    public String toString()
    returns the event in a string representation
    Overrides:
      `toString` in class `EventObject`
    Returns:
      the event in a string representation