I'm trying to access my application's tables in Play! Framework, but I can't find it using the console.
For instance, I have two entity models: Address
and Campus
.
I can create objects and save normally, but I would like to see the changes in fs or mem DB, but the H2 console doesn't show the tables Address
and Campus
. I'm using the default settings to log in localhost:9000/@db
.
What am I doing wrong?
Thanks in advance.
Accessing the H2 Console H2 database has an embedded GUI console for browsing the contents of a database and running SQL queries. By default, the H2 console is not enabled in Spring. Then, after starting the application, we can navigate to http://localhost:8080/h2-console, which will present us with a login page.
The H2 Console application lets you access a database using a browser. This can be a H2 database, or another database that supports the JDBC API. This is a client/server application, so both a server and a client (a browser) are required to run it.
H2 Console Before accessing the H2 database, we must enable it by using the following property. Once we have enabled the H2 console, now we can access the H2 console in the browser by invoking the URL http://localhost:8080/h2-console.
The correct URL for the inmemory database is:
jdbc:h2:mem:name-of-your-play-db
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With