Reputation: 279
I just started using H2 to learn SQL. I was wondering where H2 database values are stored. The main reason I'm trying to find this out is that I'd like to look at the values that I entered and see the general structure that the database takes. Currently I'm using the URL "10.53.87.49:8082" on Firefox but that doesn't show me new values entered via my main java class.
Upvotes: 3
Views: 3149
Reputation: 347314
The answer will depend on you connection URL
From the 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
Upvotes: 4