Package org.h2.tools
Class Console
java.lang.Object
org.h2.util.Tool
org.h2.tools.Console
- All Implemented Interfaces:
ShutdownHandler
- Direct Known Subclasses:
GUIConsole
Starts the H2 Console (web-) server, as well as the TCP and PG server.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
When running without options, -tcp, -web, -browser and -pg are started.(package private) void
openBrowser
(String url) Open a new browser tab or window with the given URL.private void
printProblem
(Exception e, Server server) void
This tool starts the H2 Console (web-) server, as well as the TCP and PG server.(package private) void
show()
Overridden by GUIConsole to show a windowvoid
shutdown()
INTERNAL.Methods inherited from class org.h2.util.Tool
isOption, printNoDatabaseFilesFound, setOut, showUsage, showUsageAndThrowUnsupportedOption, throwUnsupportedOption
-
Field Details
-
web
Server web -
tcp
-
pg
-
isWindows
boolean isWindows
-
-
Constructor Details
-
Console
public Console()
-
-
Method Details
-
main
When running without options, -tcp, -web, -browser and -pg are started. Options are case sensitive.Supported options [-help] or [-?] Print the list of options [-url] Start a browser and connect to this URL [-driver] Used together with -url: the driver [-user] Used together with -url: the user name [-password] Used together with -url: the password [-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 connecting to the web server [-tcp] Start the TCP server [-pg] Start the PG server - Parameters:
args
- the command line arguments- Throws:
SQLException
- on failure
-
runTool
This tool starts the H2 Console (web-) server, as well as the TCP and PG server. A system tray icon is created, for platforms that support it. Otherwise, a small window opens.- Specified by:
runTool
in classTool
- Parameters:
args
- the command line arguments- Throws:
SQLException
- on failure
-
show
void show()Overridden by GUIConsole to show a window -
printProblem
-
shutdown
public void shutdown()INTERNAL. Stop all servers that were started using the console.- Specified by:
shutdown
in interfaceShutdownHandler
-
openBrowser
Open a new browser tab or window with the given URL.- Parameters:
url
- the URL to open
-