Top Description Fields Constructors Methods
org.hsqldb.util

public Class DatabaseManager

extends Panel
implements ActionListener, WindowListener, KeyListener
Class Inheritance
All Implemented Interfaces
java.awt.event.KeyListener, java.util.EventListener, java.awt.event.WindowListener, java.awt.event.ActionListener
Imports
java.io.File, .IOException, .PrintWriter, java.sql.Connection, .DatabaseMetaData, .DriverManager, .ResultSet, .ResultSetMetaData, .SQLException, .Statement, java.util.ArrayList, java.awt.BorderLayout, .Button, .Color, .Dimension, .FileDialog, .Font, .Frame, .Image, .Menu, .MenuBar, .MenuItem, .MenuShortcut, .Panel, .TextArea, .Toolkit, java.awt.event.ActionEvent, .ActionListener, .KeyEvent, .KeyListener, .WindowEvent, .WindowListener, java.awt.image.MemoryImageSource

AWT Tool for manageing 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
              --urlid <urlid>       get connection info from RC file
              --rcfile <file>       use instead of default (with urlid)
              --dir <path>          default directory
              --script <file>       reads from script file
 
Originally in HypersonicSQL. Extended in various versions of HSQLDB.
Author
Thomas Mueller (Hypersonic SQL Group)
Since
Hypersonic SQL
Version
2.5.1

Field Summary

Modifier and TypeField and Description
private static final String
pack-priv boolean
pack-priv static boolean
pack-priv Button
pack-priv Button
pack-priv Connection
pack-priv static String
pack-priv static String
pack-priv static String
pack-priv static String
pack-priv static String
pack-priv static String
pack-priv DatabaseMetaData
pack-priv Frame
pack-priv Grid
private static final String
pack-priv String
pack-priv static final int
pack-priv Image
pack-priv int
pack-priv int
pack-priv long
pack-priv Menu
pack-priv static final String
pack-priv Panel
pack-priv String[]
pack-priv Statement
private static boolean
pack-priv Tree
pack-priv TextArea
pack-priv TextArea

Constructor Summary

AccessConstructor and Description
public

Method Summary

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

Implements java.awt.event.ActionListener.actionPerformed.

Invoked when an action occurs.

pack-priv void
addMenu(MenuBar b, String name, String[] items)

pack-priv void
private void
pack-priv void
clear()

Clear SQL Statements.

public void
pack-priv void
execute()

Adjust this method for large strings...ie multi megabtypes.

pack-priv void
public void
init()

private void
pack-priv 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()

protected void
pack-priv void
saveAsCsv(String filename)

private static void
setLogToSystem(boolean value)

pack-priv void
showHelp(String[] help)

pack-priv void
private static void
pack-priv void
public static void
pack-priv 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 java.awt.Panel:
addNotifygetAccessibleContext

Field Detail

ABOUT_TEXTback to summary
private static final String ABOUT_TEXT
bHelpback to summary
pack-priv boolean bHelp
bMustExitback to summary
pack-priv static boolean bMustExit
butClearback to summary
pack-priv Button butClear
butExecuteback to summary
pack-priv Button butExecute
cConnback to summary
pack-priv Connection cConn
defDirectoryback to summary
pack-priv static String defDirectory
defDriverback to summary
pack-priv static String defDriver
defPasswordback to summary
pack-priv static String defPassword
defScriptback to summary
pack-priv static String defScript
defURLback to summary
pack-priv static String defURL
defUserback to summary
pack-priv static String defUser
dMetaback to summary
pack-priv DatabaseMetaData dMeta
fMainback to summary
pack-priv Frame fMain
gResultback to summary
pack-priv Grid gResult
HELP_TEXTback to summary
private static final String HELP_TEXT
ifHugeback to summary
pack-priv String ifHuge
iMaxRecentback to summary
pack-priv static final int iMaxRecent
imgEmptyback to summary
pack-priv Image imgEmpty
iRecentback to summary
pack-priv int iRecent
iResultback to summary
pack-priv int iResult
lTimeback to summary
pack-priv long lTime
mRecentback to summary
pack-priv Menu mRecent
NLback to summary
pack-priv static final String NL
pResultback to summary
pack-priv Panel pResult
sRecentback to summary
pack-priv String[] sRecent
sStatementback to summary
pack-priv Statement sStatement
TT_AVAILABLEback to summary
private static boolean TT_AVAILABLE
tTreeback to summary
pack-priv Tree tTree
txtCommandback to summary
pack-priv TextArea txtCommand
txtResultback to summary
pack-priv TextArea txtResult

Constructor Detail

DatabaseManagerback to summary
public DatabaseManager()

Method Detail

actionPerformedback to summary
public void actionPerformed(ActionEvent ev)

Implements java.awt.event.ActionListener.actionPerformed.

Doc from java.awt.event.ActionListener.actionPerformed.

Invoked when an action occurs.

addMenuback to summary
pack-priv void addMenu(MenuBar b, String name, String[] items)
addMenuItemsback to summary
pack-priv void addMenuItems(Menu f, String[] m)
addToRecentback to summary
private void addToRecent(String s)
clearback to summary
pack-priv void clear()

Clear SQL Statements.

connectback to summary
public void connect(Connection c)
executeback to summary
pack-priv void execute()

Adjust this method for large strings...ie multi megabtypes.

formatResultSetback to summary
pack-priv void formatResultSet(ResultSet r)
initback to summary
public void init()
initGUIback to summary
private void initGUI()
insertTestDataback to summary
pack-priv void insertTestData()
keyPressedback to summary
public void keyPressed(KeyEvent k)

Implements java.awt.event.KeyListener.keyPressed.

Doc from java.awt.event.KeyListener.keyPressed.

Invoked when a key has been pressed. See the class description for KeyEvent for a definition of a key pressed event.

keyReleasedback to summary
public void keyReleased(KeyEvent k)

Implements java.awt.event.KeyListener.keyReleased.

Doc from java.awt.event.KeyListener.keyReleased.

Invoked when a key has been released. See the class description for KeyEvent for a definition of a key released event.

keyTypedback to summary
public void keyTyped(KeyEvent k)

Implements java.awt.event.KeyListener.keyTyped.

Doc from java.awt.event.KeyListener.keyTyped.

Invoked when a key has been typed. See the class description for KeyEvent for a definition of a key typed event.

mainback to summary
public static void main(String[] arg)

Run with --help switch for usage instructions.

Parameters
arg:String[]

arguments

Exceptions
IllegalArgumentException:
for the obvious reason
mainback to summary
public void main()
refreshTreeback to summary
protected void refreshTree()
saveAsCsvback to summary
pack-priv void saveAsCsv(String filename)
setLogToSystemback to summary
private static void setLogToSystem(boolean value)
showHelpback to summary
pack-priv void showHelp(String[] help)
showResultInTextback to summary
pack-priv void showResultInText()
showUsageback to summary
private static void showUsage()
testPerformanceback to summary
pack-priv void testPerformance()
threadedDBMback to summary
public static void threadedDBM()
updateResultback to summary
pack-priv void updateResult()
windowActivatedback to summary
public void windowActivated(WindowEvent e)

Implements java.awt.event.WindowListener.windowActivated.

Doc from java.awt.event.WindowListener.windowActivated.

Invoked when the Window is set to be the active Window. Only a Frame or a Dialog can be the active Window. The native windowing system may denote the active Window or its children with special decorations, such as a highlighted title bar. The active Window is always either the focused Window, or the first Frame or Dialog that is an owner of the focused Window.

windowClosedback to summary
public void windowClosed(WindowEvent e)

Implements java.awt.event.WindowListener.windowClosed.

Doc from java.awt.event.WindowListener.windowClosed.

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

windowClosingback to summary
public void windowClosing(WindowEvent ev)

Implements java.awt.event.WindowListener.windowClosing.

Doc from java.awt.event.WindowListener.windowClosing.

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

windowDeactivatedback to summary
public void windowDeactivated(WindowEvent e)

Implements java.awt.event.WindowListener.windowDeactivated.

Doc from java.awt.event.WindowListener.windowDeactivated.

Invoked when a Window is no longer the active Window. Only a Frame or a Dialog can be the active Window. The native windowing system may denote the active Window or its children with special decorations, such as a highlighted title bar. The active Window is always either the focused Window, or the first Frame or Dialog that is an owner of the focused Window.

windowDeiconifiedback to summary
public void windowDeiconified(WindowEvent e)

Implements java.awt.event.WindowListener.windowDeiconified.

Doc from java.awt.event.WindowListener.windowDeiconified.

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

windowIconifiedback to summary
public void windowIconified(WindowEvent e)

Implements java.awt.event.WindowListener.windowIconified.

Doc from java.awt.event.WindowListener.windowIconified.

Invoked when a window is changed from a normal to a minimized state. For many platforms, a minimized window is displayed as the icon specified in the window's iconImage property.

windowOpenedback to summary
public void windowOpened(WindowEvent e)

Implements java.awt.event.WindowListener.windowOpened.

Doc from java.awt.event.WindowListener.windowOpened.

Invoked the first time a window is made visible.