org.h2.Driver.load();
String url = "jdbc:h2:" + getBaseDir() + "/toolsConvertTraceFile";
Connection conn = DriverManager.getConnection(url + ";TRACE_LEVEL_FILE=3", "sa", "sa");
Statement stat = conn.createStatement();
stat.execute("create table test(id int primary key, name varchar, amount decimal)");
PreparedStatement prep = conn.prepareStatement("insert into test values(?, ?, ?)");
prep.setInt(1, 1);
prep.setString(2, "Hello \\'Joe\n\\'");
prep.setBigDecimal(3, new BigDecimal("10.20"));
prep.executeUpdate();
stat.execute("create table test2(id int primary key,\n" +
"a real, b double, c bigint,\n" +
"d smallint, e boolean, f binary, g date, h time, i timestamp)", Statement.NO_GENERATED_KEYS);
prep = conn.prepareStatement("insert into test2 values(1, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
prep.setFloat(1, Float.MIN_VALUE);
prep.setDouble(2, Double.MIN_VALUE);
prep.setLong(3, Long.MIN_VALUE);
prep.setShort(4, Short.MIN_VALUE);
prep.setBoolean(5, false);
prep.setBytes(6, new byte[] { (byte) 10, (byte) 20 });
prep.setDate(7, java.sql.Date.valueOf("2007-12-31"));
prep.setTime(8, java.sql.Time.valueOf("23:59:59"));
prep.setTimestamp(9, java.sql.Timestamp.valueOf("2007-12-31 23:59:59"));
prep.executeUpdate();
conn.close();
ConvertTraceFile.main("-traceFile", getBaseDir() + "/toolsConvertTraceFile.trace.db",
"-javaClass", getBaseDir() + "/Test",
"-script", getBaseDir() + "/test.sql");