I planned to use ExampleDS (java:jboss/datasources/ExampleDS) for Java development before going to production. It is the default data source, configured using the embedded H2 database for developer convenience. I need to see the data in these tables during development. I am developing in IntelliJ. There is a ”database” tab to the upper right. I have previously added databases here and I could see their content. But I don’t know how to add the ExampleDS database. I can then test the connection and it says that it is connected. But no tables are seen in the database tab, although I can see that tables are created.
I then tried this approach instead: 1) Deploy a prebuilt WAR-file for H2 Console: https://www.cs.hs-rm.de/~knauf/JavaEE6/kuchen/H2Console.war ) 2) Open URL http://localhost:8080/H2Console/h2 3) login with username/password = "sa" I could then access the H2 console. It was however impossible to login with the default JDBC URL java:jboss/datasources/ExampleDS I tried with name and password sa, but it always says "wrong password". So I read the documentation on https://developers.redhat.com/quickstarts/eap/h2-console/ It says: To access the test database that the greeter quickstart uses, enter these details: JDBC URL: jdbc:h2:mem:greeter-quickstart;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1 User Name: sa Password: sa So I tried that and I could finally connect. But there seems to be no tables in the database. The documentation says: Take a look at the data added by the greeter application. Run the following SQL command: select * from users; I tried that, but got the message Table "USERS" not found The tables that I have created in my JPA app can also not be found. I assume that is because my persistance file points to <jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source> So I changed it to <jta-data-source>jdbc:h2:mem:greeter-quickstart;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1</jta-data-source> Then I got this error when trying to run my JPA app from IntelliJ: "WFLYCTL0412: Required services that are not installed:" => ["jboss.naming.context.java.jdbc:h2:mem:greeter-quickstart;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1"], "WFLYCTL0180: Services with missing/unavailable dependencies" => [ Does anypne know how I should proceed with this to actually add my tables to a H2 database and then to see the content of these tables? It is very difficult when I can not find any proper documentation or tutorials. I read on the Wildfly docs: "a default data source, ExampleDS , is configured using the embedded H2 database for developer convenience." If this database is for developer convenience, why is there no easy tutorial which shows how to see the data in the database? What is the use of this database if we can't see the data in it? Please help me, so I can finally add a H2 database and see the data in its tables. -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/h2-database/0f38264d-5f82-4189-bc72-08bb94d3b229%40googlegroups.com.
