Package weka.gui.sql

Class SqlViewer

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ConnectionListener, HistoryChangedListener, QueryExecuteListener, ResultChangedListener

Represents a little tool for querying SQL databases.
Version:
$Revision: 14777 $
Author:
FracPete (fracpete at waikato dot ac dot nz)
See Also:
  • Field Details

  • Constructor Details

    • SqlViewer

      public SqlViewer(JFrame parent)
      initializes the SqlViewer.
      Parameters:
      parent - the parent of this panel
  • Method Details

    • connectionChange

      public void connectionChange(ConnectionEvent evt)
      This method gets called when the connection is either established or disconnected.
      Specified by:
      connectionChange in interface ConnectionListener
      Parameters:
      evt - the event
    • queryExecuted

      public void queryExecuted(QueryExecuteEvent evt)
      This method gets called when a query has been executed.
      Specified by:
      queryExecuted in interface QueryExecuteListener
      Parameters:
      evt - the event
    • resultChanged

      public void resultChanged(ResultChangedEvent evt)
      This method gets called when a query has been executed.
      Specified by:
      resultChanged in interface ResultChangedListener
      Parameters:
      evt - the event
    • historyChanged

      public void historyChanged(HistoryChangedEvent evt)
      This method gets called when a history is modified. It saves the history immediately to the users home directory.
      Specified by:
      historyChanged in interface HistoryChangedListener
      Parameters:
      evt - the event
    • saveSize

      public void saveSize()
      obtains the size of the panel and saves it in the history.
      See Also:
      • saveHistory()
    • clear

      public void clear()
      calls the clear method of all sub-panels to set back to default values and free up memory.
    • getURL

      public String getURL()
      returns the database URL from the currently active tab in the ResultPanel, otherwise an empty string.
      Returns:
      the currently selected tab's URL
      See Also:
    • getUser

      public String getUser()
      returns the user from the currently active tab in the ResultPanel, otherwise an empty string.
      Returns:
      the currently selected tab's user
      See Also:
    • getPassword

      public String getPassword()
      returns the password from the currently active tab in the ResultPanel, otherwise an empty string.
      Returns:
      the currently selected tab's password
      See Also:
    • getQuery

      public String getQuery()
      returns the query from the currently active tab in the ResultPanel, otherwise an empty string.
      Returns:
      the currently selected tab's query
      See Also:
    • addConnectionListener

      public void addConnectionListener(ConnectionListener l)
      adds the given listener to the list of listeners.
      Parameters:
      l - the listener to add to the list
    • removeConnectionListener

      public void removeConnectionListener(ConnectionListener l)
      removes the given listener from the list of listeners.
      Parameters:
      l - the listener to remove
    • addQueryExecuteListener

      public void addQueryExecuteListener(QueryExecuteListener l)
      adds the given listener to the list of listeners.
      Parameters:
      l - the listener to add to the list
    • removeQueryExecuteListener

      public void removeQueryExecuteListener(QueryExecuteListener l)
      removes the given listener from the list of listeners.
      Parameters:
      l - the listener to remove
    • addResultChangedListener

      public void addResultChangedListener(ResultChangedListener l)
      adds the given listener to the list of listeners.
      Parameters:
      l - the listener to add to the list
    • removeResultChangedListener

      public void removeResultChangedListener(ResultChangedListener l)
      removes the given listener from the list of listeners.
      Parameters:
      l - the listener to remove
    • addHistoryChangedListener

      public void addHistoryChangedListener(HistoryChangedListener l)
      adds the given listener to the list of listeners.
      Parameters:
      l - the listener to add to the list
    • removeHistoryChangedListener

      public void removeHistoryChangedListener(HistoryChangedListener l)
      removes the given listener from the list of listeners.
      Parameters:
      l - the listener to remove
    • main

      public static void main(String[] args)
      starts the SQL-Viewer interface.
      Parameters:
      args - the commandline arguments - ignored