See JavaDocs for the main method for syntax of how to run from the command-line.
Programmatic users will usually want to use the objectMain(String[]) method
if they want arguments and behavior exactly like command-line SqlTool.
But in many cases, you will have better control and efficiency by using
the SqlFile class directly. The file
src/org/hsqldb/sample/SqlFileEmbedder.java
in the HSQLDB distribution provides an example for this latter strategy.
main(String[]), objectMain(String[]), SqlFile
| Modifier and Type | Class and Description |
|---|---|
| private static class | SqlTool.
Utility nested class for internal use. |
| private static class | SqlTool.
For trapping of exceptions inside this class. |
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final SqlTool. | bcl
Utility object for internal use. |
| private static final String | CMDLINE_ID
The configuration identifier to use when connection parameters are specified on the command line |
| public static final int | |
| public static final String | |
| public static final int | |
| public static final int | |
| public static final int | |
| private static final FrameworkLogger | |
| public static final String | LS
Platform-specific line separator |
| public static final int | |
| private static final String | |
| private static final String | |
| private static final int | |
| public static final int | |
| public static final int | |
| public static final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static void | |
| public static void | objectMain(final String[]
Run "java... org.hsqldb.cmdline.SqlTool --help" for syntax. arg)Connect to a JDBC Database and execute the commands given on stdin or in SQL file(s). |
| private static String | Returns: The password the user enteredThe user the password is for username)Prompt the user for a password. |
| private static void |
| bcl | back to summary |
|---|---|
| private static final SqlTool. Utility object for internal use. | |
| CMDLINE_ID | back to summary |
|---|---|
| private static final String CMDLINE_ID The configuration identifier to use when connection parameters are specified on the command line | |
| CONNECTERR_EXITVAL | back to summary |
|---|---|
| public static final int CONNECTERR_EXITVAL | |
| DEFAULT_RCFILE | back to summary |
|---|---|
| public static final String DEFAULT_RCFILE | |
| FILEERR_EXITVAL | back to summary |
|---|---|
| public static final int FILEERR_EXITVAL | |
| INPUTERR_EXITVAL | back to summary |
|---|---|
| public static final int INPUTERR_EXITVAL | |
| IOERR_EXITVAL | back to summary |
|---|---|
| public static final int IOERR_EXITVAL | |
| logger | back to summary |
|---|---|
| private static final FrameworkLogger logger | |
| LS | back to summary |
|---|---|
| public static final String LS Platform-specific line separator | |
| RCERR_EXITVAL | back to summary |
|---|---|
| public static final int RCERR_EXITVAL | |
| revnum | back to summary |
|---|---|
private static final String revnum
| |
| revString | back to summary |
|---|---|
| private static final String revString | |
| revStringLength | back to summary |
|---|---|
| private static final int revStringLength | |
| SQLERR_EXITVAL | back to summary |
|---|---|
| public static final int SQLERR_EXITVAL | |
| SQLTOOLERR_EXITVAL | back to summary |
|---|---|
| public static final int SQLTOOLERR_EXITVAL | |
| SYNTAXERR_EXITVAL | back to summary |
|---|---|
| public static final int SYNTAXERR_EXITVAL | |
| SqlTool | back to summary |
|---|---|
| public SqlTool() | |
| main | back to summary |
|---|---|
| public static void main(final String[] args) A static wrapper for objectMain, so that that method may be executed as a Java "program". Throws only RuntimeExceptions or Errors, because this method is intended to System.exit() for all but disastrous system problems, for which the inconvenience of a stack trace would be the least of your worries. If you don't want SqlTool to System.exit(), then use the method objectMain() instead of this method.
| |
| objectMain | back to summary |
|---|---|
| public static void objectMain(final String[] arg) throws SqlToolException Connect to a JDBC Database and execute the commands given on stdin or in SQL file(s). This method is changed for HSQLDB 1.8.0.8 and later to never System.exit(). Developers may catch Throwables to handle all fatal situations.
| |
| promptForPassword | back to summary |
|---|---|
| private static String promptForPassword(final String username) throws PrivateException Prompt the user for a password. | |
| varParser | back to summary |
|---|---|
| private static void varParser(final String inVarString, final Map<String, String> varMap, final boolean lowerCaseKeys) throws PrivateException Parses a comma delimited string of name value pairs into a
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| serialVersionUID | back to summary |
|---|---|
| pack-priv static final long serialVersionUID | |
| BadCmdline | back to summary |
|---|---|
| pack-priv BadCmdline() | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| serialVersionUID | back to summary |
|---|---|
| pack-priv static final long serialVersionUID | |
| PrivateException | back to summary |
|---|---|
| pack-priv PrivateException(String s) | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | |
| pack-priv static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv | |
| pack-priv |
| exitValue | back to summary |
|---|---|
| pack-priv int exitValue | |
| serialVersionUID | back to summary |
|---|---|
| pack-priv static final long serialVersionUID | |
| SqlToolException | back to summary |
|---|---|
| pack-priv SqlToolException(String message, int exitValue) | |
| SqlToolException | back to summary |
|---|---|
| pack-priv SqlToolException(int exitValue, String message) | |
| SqlToolException | back to summary |
|---|---|
| pack-priv SqlToolException(int exitValue) | |