diff --git a/templates/standalone-ha.xml.j2 b/templates/standalone-ha.xml.j2
index 249369f..00b4c5d 100644
--- a/templates/standalone-ha.xml.j2
+++ b/templates/standalone-ha.xml.j2
@@ -132,14 +132,6 @@
-
- jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
- h2
-
- sa
- sa
-
-
{% if keycloak_use_external_db %}
jdbc:{{ keycloak_db }}://{{ keycloak_database_host }}/{{ keycloak_database_name }}
@@ -154,6 +146,14 @@
{% else %}
+
+ jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
+ h2
+
+ sa
+ sa
+
+
jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER=TRUE
h2
diff --git a/templates/standalone.xml.j2 b/templates/standalone.xml.j2
index 6ca569b..973395b 100644
--- a/templates/standalone.xml.j2
+++ b/templates/standalone.xml.j2
@@ -130,14 +130,6 @@
-
- jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
- h2
-
- sa
- sa
-
-
{% if keycloak_use_external_db %}
jdbc:{{ keycloak_db }}://{{ keycloak_database_host }}/{{ keycloak_database_name }}
@@ -152,6 +144,14 @@
{% else %}
+
+ jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
+ h2
+
+ sa
+ sa
+
+
jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER=TRUE
h2