有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java H2数据库存储在哪里?

我刚开始使用H2学习SQL。我想知道H2数据库值存储在哪里。我试图找出这一点的主要原因是,我希望查看我输入的值,并查看数据库采用的一般结构。目前我在Firefox上使用URL“10.53.87.49:8082”,但它没有显示通过主java类输入的新值


共 (1) 个答案

  1. # 1 楼答案

    答案将取决于您的连接URL

    来自FAQs

    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\ or C:\Users\. 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 /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