protected void connect(){
  if (m_DbUtils.isConnected()) {
    try {
      m_DbUtils.disconnectFromDatabase();
      notifyConnectionListeners(ConnectionEvent.DISCONNECT);
    }
 catch (    Exception e) {
      e.printStackTrace();
      notifyConnectionListeners(ConnectionEvent.DISCONNECT,e);
    }
  }
  try {
    m_DbUtils.setDatabaseURL(getURL());
    m_DbUtils.setUsername(getUser());
    m_DbUtils.setPassword(getPassword());
    m_DbUtils.connectToDatabase();
    notifyConnectionListeners(ConnectionEvent.CONNECT);
    addHistory(getUser() + "@" + getURL());
  }
 catch (  Exception e) {
    e.printStackTrace();
    notifyConnectionListeners(ConnectionEvent.CONNECT,e);
  }
  setButtons();
}

protected void connect ( ) { if ( m_DbUtils . isConnected ( ) ) { try { m_DbUtils . disconnectFromDatabase ( ) ; notifyConnectionListeners ( ConnectionEvent . DISCONNECT ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; notifyConnectionListeners ( ConnectionEvent . DISCONNECT , e ) ; } } try { m_DbUtils . setDatabaseURL ( getURL ( ) ) ; m_DbUtils . setUsername ( getUser ( ) ) ; m_DbUtils . setPassword ( getPassword ( ) ) ; m_DbUtils . connectToDatabase ( ) ; notifyConnectionListeners ( ConnectionEvent . CONNECT ) ; addHistory ( getUser ( ) + "@" + getURL ( ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; notifyConnectionListeners ( ConnectionEvent . CONNECT , e ) ; } setButtons ( ) ; }
connects to the database , notifies the listeners .
