h2 (embedded mode ) database files problem

前端 未结 4 1862
刺人心
刺人心 2020-12-03 14:47

There is a h2-database file in my src directory (Java, Eclipse): h2test.db

The problem:

  • starting the h2.jar from the command line (and thus the h2 b

4条回答
  •  难免孤独
    2020-12-03 14:55

    For embedded mode, you'll need to check the path. For example, use a path relative to your home directory:

    "jdbc:h2:file:~/db/h2test.db"
    

    To be sure, use a full path:

    "jdbc:h2:file:/users/aeter/db/h2test.db"
    

    For convenience, append ;IFEXISTS=TRUE to avoid creating spurious database files.

    See Connecting to a Database using JDBC for more.

    H2 Server URLs are relative to the -baseDir specified as a parameter to main().

提交回复
热议问题