Package org.hsqldb.util
Class SqlTool
- java.lang.Object
-
- org.hsqldb.util.SqlTool
-
public class SqlTool extends java.lang.Object
Sql Tool. A command-line and/or interactive SQL tool. (Note: For every Javadoc block comment, I'm using a single blank line immediately after the description, just like's Sun's examples in their Coding Conventions document). See JavaDocs for the main method for syntax of how to run. This class is mostly used in a static (a.o.t. object) way, because most of the work is done in the static main class. This class should be refactored so that the main work is done in an object method, and the static main invokes the object method. Then programmatic users could use instances of this class in the normal Java way.- Author:
- Blaine Simpson unsaved@users
- See Also:
#main()
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SqlTool.SqlToolException
-
Field Summary
Fields Modifier and Type Field Description static int
CONNECTERR_EXITVAL
static int
FILEERR_EXITVAL
static int
INPUTERR_EXITVAL
static int
IOERR_EXITVAL
static java.lang.String
LS
static int
RCERR_EXITVAL
static int
SQLERR_EXITVAL
static int
SQLTOOLERR_EXITVAL
static int
SYNTAXERR_EXITVAL
-
Constructor Summary
Constructors Constructor Description SqlTool()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
main(java.lang.String[] args)
A static wrapper for objectMain, so that that method may be executed as a Java "program".static void
objectMain(java.lang.String[] arg)
Connect to a JDBC Database and execute the commands given on stdin or in SQL file(s).
-
-
-
Field Detail
-
SQLTOOLERR_EXITVAL
public static final int SQLTOOLERR_EXITVAL
- See Also:
- Constant Field Values
-
SYNTAXERR_EXITVAL
public static final int SYNTAXERR_EXITVAL
- See Also:
- Constant Field Values
-
RCERR_EXITVAL
public static final int RCERR_EXITVAL
- See Also:
- Constant Field Values
-
SQLERR_EXITVAL
public static final int SQLERR_EXITVAL
- See Also:
- Constant Field Values
-
IOERR_EXITVAL
public static final int IOERR_EXITVAL
- See Also:
- Constant Field Values
-
FILEERR_EXITVAL
public static final int FILEERR_EXITVAL
- See Also:
- Constant Field Values
-
INPUTERR_EXITVAL
public static final int INPUTERR_EXITVAL
- See Also:
- Constant Field Values
-
CONNECTERR_EXITVAL
public static final int CONNECTERR_EXITVAL
- See Also:
- Constant Field Values
-
LS
public static java.lang.String LS
-
-
Method Detail
-
main
public static void main(java.lang.String[] args)
A static wrapper for objectMain, so that that method may be executed as a Java "program". Throws only RuntimExceptions or Errors, because this method is intended to System.exit() for all but disasterous system problems, for which the inconvenience of a 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.- See Also:
objectMain(java.lang.String[])
-
objectMain
public static void objectMain(java.lang.String[] arg) throws SqlTool.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 1.9.0.x to never System.exit().- Parameters:
arg
- Run "java... org.hsqldb.util.SqlTool --help" for syntax.- Throws:
SqlTool.SqlToolException
- Upon any fatal error, with useful reason as the exception's message.
-
-