Introduction to datasources
One of the most important features an application ever has, is the ability to save its state to a database.
JBoss EAP 7 supports this ability with the concept of a datasource
, which is the place you configure connectivity settings. Furthermore, JBoss supports your environment even more, by providing an in- memory database for development purposes, named H2 database
.
JBoss EAP 7 has a dedicated subsystem to configure datasources
. By default, the ExampleDS
is configured and bound to the H2 database
by its driver, as follows:
<subsystem xmlns="urn:jboss:domain:datasources:4.0"> <datasources> <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true"> <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY= -1;DB_CLOSE_ON_EXIT=FALSE</connection-url> <driver>h2</driver> ...