[英]Where is the H2 database stored?
I am trying to use an H2
database with Java
. 我正在尝试在
Java
使用H2
数据库。 I cannot seem to find out where the data is being written. 我似乎找不到要写入数据的位置。
The database URL I am giving is: jdbc:h2:/db/bh
. 我提供的数据库URL是:
jdbc:h2:/db/bh
。
I am connecting with the database using Java
like so: 我正在使用
Java
连接数据库,如下所示:
dbObj.setDBConnection(DriverManager.getConnection(hObj.getDBUrl(), hObj.getDBUsername(), hObj.getDBPassword()));
where DB URL is given above. 上面给出了数据库URL。
Username: sa 用户名:sa
Password: (empty). 密码:(空)。
I am running the jar
from within the following folder: 我正在以下文件夹中运行
jar
:
C:\\work\\sampleH2\\sampleH2.jar
My understanding of the FAQ section of H2 says that the database bh
will be found in the folder db/
of the folder sampleH2
. 我对H2的FAQ部分的理解是,数据库
bh
将在sampleH2
文件夹的db/
文件夹中sampleH2
。 But that is not the case. 但事实并非如此。 Where can I find it?
在哪里可以找到它?
according to http://www.h2database.com/html/cheatSheet.html there is a difference between storing in: 根据http://www.h2database.com/html/cheatSheet.html ,两者之间存在区别:
so i would look for it on your main drive (probably c:) under path you specified 所以我会在您指定的路径下的主驱动器(可能是c :)上查找它
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.