Class ConvertTraceFile
java.lang.Object
org.h2.util.Tool
org.h2.tools.ConvertTraceFile
Converts a .trace.db file to a SQL script and Java source code.
SQL statement statistics are listed as well.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classThis class holds statistics about a SQL statement. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final HashMap<String, ConvertTraceFile.Stat> private long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddToStats(String sql, int resultCount, long time) private voidconvertFile(String traceFileName, String javaClassName, String script) Converts a trace file to a Java class file and a script file.static voidOptions are case sensitive.private static StringpadNumberLeft(long number, int digits) private static StringvoidRun the tool with the given output stream and arguments.Methods inherited from class Tool
isOption, printNoDatabaseFilesFound, setOut, showUsage, showUsageAndThrowUnsupportedOption, throwUnsupportedOption
-
Field Details
-
stats
-
timeTotal
private long timeTotal
-
-
Constructor Details
-
ConvertTraceFile
public ConvertTraceFile()
-
-
Method Details
-
main
Options are case sensitive.Supported options [-help] or [-?] Print the list of options [-traceFile <file>] The trace file name (default: test.trace.db) [-script <file>] The script file name (default: test.sql) [-javaClass <file>] The Java directory and class file name (default: Test) - Parameters:
args- the command line arguments- Throws:
SQLException- on failure
-
runTool
Description copied from class:ToolRun the tool with the given output stream and arguments.- Specified by:
runToolin classTool- Parameters:
args- the argument list- Throws:
SQLException- on failure
-
convertFile
private void convertFile(String traceFileName, String javaClassName, String script) throws IOException Converts a trace file to a Java class file and a script file.- Throws:
IOException
-
removeNewlines
-
padNumberLeft
-
addToStats
-