Top Description Inners Fields Constructors Methods
org.hsqldb.util

public Class DatabaseManagerSwing

extends JFrame
implements ActionListener, WindowListener, KeyListener, MouseListener
Class Inheritance
All Implemented Interfaces
java.awt.event.MouseListener, java.util.EventListener, java.awt.event.KeyListener, java.awt.event.WindowListener, java.awt.event.ActionListener
Imports
java.io.File, .FileInputStream, .FileOutputStream, .IOException, .PrintWriter, java.sql.Connection, .DatabaseMetaData, .Driver, .DriverManager, .ResultSet, .ResultSetMetaData, .SQLException, .Statement, java.text.DecimalFormat, java.util.ArrayList, .Collections, .Enumeration, .HashMap, .HashSet, .Hashtable, .Iterator, .Locale, .Properties, java.awt.BorderLayout, .Component, .Container, .Cursor, .Dimension, .Font, .Insets, .Toolkit, java.awt.event.ActionEvent, .ActionListener, .InputEvent, .KeyEvent, .KeyListener, .MouseEvent, .MouseListener, .WindowEvent, .WindowListener, javax.swing.AbstractButton, .ButtonGroup, .ImageIcon, .JButton, .JCheckBoxMenuItem, .JComponent, .JFileChooser, .JFrame, .JLabel, .JMenu, .JMenuBar, .JMenuItem, .JOptionPane, .JPanel, .JPopupMenu, .JRadioButtonMenuItem, .JScrollPane, .JSplitPane, .JTable, .JTextArea, .JToolBar, .JTree, .KeyStroke, .RootPaneContainer, .SwingUtilities, javax.swing.table.TableModel, javax.swing.tree.DefaultMutableTreeNode, .DefaultTreeModel, .MutableTreeNode, .TreeNode, .TreePath

Swing Tool for managing a JDBC database.
Usage: java DatabaseManagerSwing [--options]
            where options include:
             --driver <classname>  jdbc driver class
             --url <name>          jdbc url
             --user <name>         username used for connection
             --password <password> password for this user
             --dir <path>          default directory
             --script <file>       reads from script file
             --urlid <urlid>       get connection info from RC file
             --rcfile <file>       use instead of default (with urlid)
             --noexit              Don't exit JVM

Note that the sys-table switch will not work for Oracle, because Oracle does not categorize their system tables correctly in the JDBC Metadata.
Authors
dmarshall@users, Bob Preston (sqlbob@users dot sourceforge.net)
Since
1.7.0
Version
2.7.3

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
DatabaseManagerSwing.DBMPrefs

Persisted User Preferences for DatabaseManagerSwing.

private class
protected class

Field Summary

Modifier and TypeField and Description
private static final String
private MouseEvent
private static final String
private boolean
private static final String
pack-priv boolean
pack-priv static boolean
pack-priv JCheckBoxMenuItem
pack-priv JCheckBoxMenuItem
pack-priv JCheckBoxMenuItem
pack-priv JCheckBoxMenuItem
pack-priv JCheckBoxMenuItem
pack-priv JCheckBoxMenuItem
pack-priv JCheckBoxMenuItem
pack-priv JCheckBoxMenuItem
private String
private static final int
private final Runnable
private Thread
pack-priv Connection
pack-priv String
private static final String
pack-priv static String
private final Runnable
pack-priv boolean
pack-priv DatabaseMetaData
private final Runnable
pack-priv JSplitPane
pack-priv RootPaneContainer
pack-priv Cursor
private static final String
pack-priv GridSwing
pack-priv JTable
gResultTable

I think this is used to store model info whether we're using Grid output or not (this object is queried for data to display for text output mode).

private static final String
private boolean
pack-priv JScrollPane
private static final String
private static String
pack-priv static int
pack-priv static JButton
pack-priv int
private boolean
private JButton
private JButton
private JFrame
pack-priv JLabel
pack-priv ArrayList<JMenuItem>
private static final String
pack-priv long
pack-priv JMenuItem
pack-priv JMenuItem
pack-priv JMenuItem
private final JMenu
pack-priv JMenu
pack-priv static final String
private static final String[]
pack-priv JSplitPane
pack-priv static final String
private static final String[]
private static final HashSet<String>
private DatabaseManagerSwing.DBMPrefs
pack-priv JPanel
pack-priv JPanel
pack-priv JRadioButtonMenuItem
pack-priv JRadioButtonMenuItem
pack-priv JRadioButtonMenuItem
pack-priv JRadioButtonMenuItem
pack-priv static String
pack-priv DefaultMutableTreeNode
pack-priv Connection
private static final String
private String
pack-priv ActionListener
pack-priv boolean
private boolean
private static final String
pack-priv boolean
private static final String
private static final String
private boolean
pack-priv String
sqlScriptBuffer

Value of this variable only retained if huge input script read in.

pack-priv String[]
pack-priv Statement
pack-priv TableModel
pack-priv HashMap<AbstractButton, String>
pack-priv DefaultTreeModel
private final Runnable
pack-priv JScrollPane
private static final String
private static boolean
pack-priv JTree
pack-priv JTextArea
pack-priv Cursor
pack-priv JScrollPane
pack-priv JTextArea
pack-priv Cursor
pack-priv JScrollPane
private static final String[]
private final Cursor
waitCursor

Wait Cursor

Inherited from javax.swing.JFrame:
accessibleContextrootPanerootPaneCheckingEnabled

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
actionPerformed(ActionEvent ev)

Implements java.awt.event.ActionListener.actionPerformed.

Invoked when an action occurs.

private JMenu
addMenu(JMenuBar b, String name, Object[] items)

private void
private void
private void
backgroundIt(Runnable r, String description)

private void
private void
public void
connect(Connection
Connection
c
)

This stuff is all quick, except for the refreshTree().

protected JToolBar
protected void
directRefreshTree()

Clear all existing nodes from the tree model and rebuild from scratch.

private void
protected void
executeCurrentSQL()

Schedules to run in a Gui-safe thread

private void
private void
formatResultSet(ResultSet r)

We let Swing handle displaying nulls (which it generally does by printing nothing for them), except for the case of database VARCHARs, because this is the only class where there is any ambiguity about whether there is a null stored or not.

protected int[]
getRowCounts(ArrayList<E> inTable, ArrayList<E> inSchema)

public final void
private void
private void
public void
keyPressed(KeyEvent k)

Implements java.awt.event.KeyListener.keyPressed.

Invoked when a key has been pressed.

public void
keyReleased(KeyEvent k)

Implements java.awt.event.KeyListener.keyReleased.

Invoked when a key has been released.

public void
keyTyped(KeyEvent k)

Implements java.awt.event.KeyListener.keyTyped.

Invoked when a key has been typed.

public static void
main(String[]
arguments
arg
)

Run with --help switch for usage instructions.

public void
main()

private DefaultMutableTreeNode
makeNode(Object userObject, MutableTreeNode parent)

public final void
mouseClicked(final MouseEvent mouseEvent)

Implements java.awt.event.MouseListener.mouseClicked.

Invoked when the mouse button has been clicked (pressed and released) on a component.

public final void
mouseEntered(final MouseEvent mouseEvent)

Implements java.awt.event.MouseListener.mouseEntered.

Invoked when the mouse enters a component.

public final void
mouseExited(final MouseEvent mouseEvent)

Implements java.awt.event.MouseListener.mouseExited.

Invoked when the mouse exits a component.

public final void
mousePressed(final MouseEvent e)

Implements java.awt.event.MouseListener.mousePressed.

Invoked when a mouse button has been pressed on a component.

public final void
mouseReleased(final MouseEvent e)

Implements java.awt.event.MouseListener.mouseReleased.

Invoked when a mouse button has been released on a component.

private String
quoteObjectName(String name)

perform a limited check (inconclusive) and quote object name if required

private String
quoteTableName(String name)

Perform a limited check (inconclusive) and quote object name if required.

protected void
refreshTree()

Schedules to run in a Gui-safe thread

pack-priv void
private void
setLF(String newLAF)

private static void
setLogToSystem(boolean value)

private void
private void
pack-priv void
setStatusLine(String busyBaseString, int rowCount)

public void
setWaiting(String description)

private void
showHelp(String[] help)

private void
private static void
public void
public void
stop()

private void
pack-priv void
private void
updateResult()

Could somebody explain what the purpose of this method is?

private void
public void
windowActivated(WindowEvent e)

Implements java.awt.event.WindowListener.windowActivated.

Invoked when the Window is set to be the active Window.

public void
windowClosed(WindowEvent e)

Implements java.awt.event.WindowListener.windowClosed.

Invoked when a window has been closed as the result of calling dispose on the window.

public void
windowClosing(WindowEvent ev)

Implements java.awt.event.WindowListener.windowClosing.

Invoked when the user attempts to close the window from the window's system menu.

public void
windowDeactivated(WindowEvent e)

Implements java.awt.event.WindowListener.windowDeactivated.

Invoked when a Window is no longer the active Window.

public void
windowDeiconified(WindowEvent e)

Implements java.awt.event.WindowListener.windowDeiconified.

Invoked when a window is changed from a minimized to a normal state.

public void
windowIconified(WindowEvent e)

Implements java.awt.event.WindowListener.windowIconified.

Invoked when a window is changed from a normal to a minimized state.

public void
windowOpened(WindowEvent e)

Implements java.awt.event.WindowListener.windowOpened.

Invoked the first time a window is made visible.

Inherited from javax.swing.JFrame:
addImplcreateRootPaneframeInitgetAccessibleContextgetContentPanegetDefaultCloseOperationgetGlassPanegetGraphicsgetJMenuBargetLayeredPanegetRootPanegetTransferHandlerisDefaultLookAndFeelDecoratedisRootPaneCheckingEnabledparamStringprocessWindowEventremoverepaintsetContentPanesetDefaultCloseOperationsetDefaultLookAndFeelDecoratedsetGlassPanesetIconImagesetJMenuBarsetLayeredPanesetLayoutsetRootPanesetRootPaneCheckingEnabledsetTransferHandlerupdate