H2 数据库的 .db 数据库 文件 存放位置 修改

官方原文

Where are the Database Files Stored?


When using database URLs like jdbc:h2:~/test, the database is stored in the user directory. For Windows, this is usually C:\Documents and Settings\<userName> or C:\Users\<userName>. If the base directory is not set (as in jdbc:h2:test), the database files are stored in the directory where the application is started (the current working directory). When using the H2 Console application from the start menu, this is <Installation Directory>/bin. The base directory can be set in the database URL. A fixed or relative path can be used. When using the URL jdbc:h2:file:data/sample, the database is stored in the directory data (relative to the current working directory). The directory is created automatically if it does not yet exist. It is also possible to use the fully qualified directory name (and for Windows, drive name). Example: jdbc:h2:file:C:/data/test

译文:

数据库文件存放在哪里?

当使用JDBC数据库路径:jdbc:h2:~/test,数据库是存储在用户目录。对于Windows,这通常是C:\Documents and Settings\<userName> or C:\Users\<userName>。如果没有设置库目录(如jdbc:h2:test),数据库文件存储在目录中的应用程序的启动(当前工作目录)。当使用H2的控制台应用程序从开始菜单,这是<安装目录> /箱。基目录可以在数据库中设置的URL。一个固定的路径或相对路径可以用。使用URL :jdbc:h2:file:data/sample,数据库是存储在目录数据(相对于当前的工作目录)。目录是如果它不存在自动创建。它也可以使用完全限定的目录的名称(和Windows,驱动器名称)。例如:jdbc:h2:file:C:/data/test


你可能感兴趣的:(H2 数据库的 .db 数据库 文件 存放位置 修改)