2015-04-28 60 views
0

我试图在Linux中创建一个数据库,其中:H2错误[90011-187]

  1. 它不是在用户家
  2. 不要求客户告知整个服务器路径, db文件。
  3. 需要与bin目录不同以防止核心转储失败。

文档说,你可以使用这样的URL:

jdbc:h2:file:data/sample 

,但这个简单的URL不起作用,并得到下列错误:

Exception in thread "main" org.h2.jdbc.JdbcSQLException: A file path 
that is implicitly relative to the current working directory is not 
allowed in the database URL 
"jdbc:h2:file:db/datadb;TRACE_LEVEL_FILE=3". Use an absolute path, 
~/name, ./name, or the baseDir setting instead. [90011-187] 

观察:我知道你可以使用“。”,但在这种情况下,客户端的网址是什么?

回答

3

该文档是错误的。我会更新它。

jdbc:h2:file:data/sample 

它应该是:

jdbc:h2:file:./data/sample 

许多用户遇到了问题,因为他们使用像jdbc:h2:test,然后要么没有找到数据库文件,或者创建运行应用程序时,第二个数据库一个不同的目录。这就是为什么在版本1.4.x中,现在相对路径仅在使用.时才起作用,如在jdb:h2:./test中。

对不起,你问这个问题in the H2 Google Group as well