org.h2.tools
Class Console

java.lang.Object
  extended by org.h2.util.Tool
      extended by org.h2.tools.Console
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.MouseListener, java.util.EventListener, ShutdownHandler

public class Console
extends Tool
implements java.awt.event.ActionListener, java.awt.event.MouseListener, ShutdownHandler

Starts the H2 Console (web-) server, as well as the TCP and PG server.

Author:
Thomas Mueller, Ridvan Agar

Field Summary
 
Fields inherited from class org.h2.util.Tool
out
 
Constructor Summary
Console()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          INTERNAL
static void main(java.lang.String... args)
          When running without options, -tcp, -web, -browser and -pg are started.
 void mouseClicked(java.awt.event.MouseEvent e)
          INTERNAL
 void mouseEntered(java.awt.event.MouseEvent e)
          INTERNAL
 void mouseExited(java.awt.event.MouseEvent e)
          INTERNAL
 void mousePressed(java.awt.event.MouseEvent e)
          INTERNAL
 void mouseReleased(java.awt.event.MouseEvent e)
          INTERNAL
 void run(java.lang.String... args)
          This tool starts the H2 Console (web-) server, as well as the TCP and PG server.
 void shutdown()
          INTERNAL
 
Methods inherited from class org.h2.util.Tool
printNoDatabaseFilesFound, readArgBoolean, setOut, showUsage, throwUnsupportedOption
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Console

public Console()
Method Detail

main

public static void main(java.lang.String... args)
                 throws java.sql.SQLException
When running without options, -tcp, -web, -browser and -pg are started.
Options are case sensitive. Supported options are:
[-help] or [-?] Print the list of options
[-web] Start the web server with the H2 Console
[-tool] Start the icon or window that allows to start a browser
[-browser] Start a browser and open a page to connect to the web server
[-tcp] Start the TCP server
[-pg] Start the PG server
For each Server, additional options are available; for details, see the Server tool.
If a service can not be started, the program terminates with an exit code of 1.

Parameters:
args - the command line arguments
Throws:
java.sql.SQLException

run

public void run(java.lang.String... args)
         throws java.sql.SQLException
This tool starts the H2 Console (web-) server, as well as the TCP and PG server. For JDK 1.6, a system tray icon is created, for platforms that support it. Otherwise, a small window opens.

Specified by:
run in class Tool
Parameters:
args - the command line arguments
Throws:
java.sql.SQLException

shutdown

public void shutdown()
INTERNAL

Specified by:
shutdown in interface ShutdownHandler

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
INTERNAL

Specified by:
actionPerformed in interface java.awt.event.ActionListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
INTERNAL

Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
INTERNAL

Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
INTERNAL

Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
INTERNAL

Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
INTERNAL

Specified by:
mouseReleased in interface java.awt.event.MouseListener