Hi,

> the log file name

What version of H2 do you use? It sounds like a very old version.
There is no log file any more since quite a long time.

With a recent version, it works according to my test:

http://h2database.com/p.html#a82f1f9d0b578da9fe8daaf7388debab

package db;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import org.h2.tools.DeleteDbFiles;

public class TestSimpleDb {

    public static void main(String... args) throws Exception {
        Class.forName("org.h2.Driver");
        String url = "jdbc:h2:~/temp/test";
        Connection conn = DriverManager.getConnection(url);
        Statement stat = conn.createStatement();
        stat.execute("create table if not exists test(name varchar)");
        ResultSet rs = stat.executeQuery("select * from test");
        while (rs.next()) {
            System.out.println("Row found: " + rs.getString(1));
        }

        System.out.println("deleting the database now");
        conn.close();
        DeleteDbFiles.execute("~/temp", "test", true);

        System.out.println("recreating the database");
        conn = DriverManager.getConnection(url);
        stat = conn.createStatement();
        stat.execute("create table if not exists test(name varchar)");

        System.out.println("adding one row");
        stat.execute("insert into test values(now())");

        // or Thread.sleep(1000);
        stat.execute("checkpoint");

        System.out.println("killing the process now - please restart");
        Runtime.getRuntime().halt(0);
    }

}

Regards,
Thomas

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to