2 Replies Latest reply on Oct 13, 2014 8:34 PM by Congmin Min

    Configure H2 server mode database

    Congmin Min Newbie

      Hollo, I is testing the H2 database in wildfly 8 with the greeter example including in the QuickStart demos.  In the Web-INF/greeter-quickstart-ds.xml, I changed to "jdbc:h2:tcp://localhost/~/" from "jdbc:h2:mem:", then restart the server, it reports a "File Not Found" error. Should I make any other change in the settings?

       

      <datasource jndi-name="java:jboss/datasources/GreeterQuickstartDS"

              pool-name="greeter-quickstart" enabled="true" use-java-context="true">

              <connection-url>jdbc:h2:mem:greeter-quickstart;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1</connection-url>

              <driver>h2</driver>

              <security>

                  <user-name>sa</user-name>

                  <password>sa</password>

              </security>

          </datasource>

       

      I didn't change anything in the persistence.xml:

       

        <persistence-unit name="primary">

              <!-- If you are running in a production environment, add a managed

                  data source, this example data source is just for development and testing! -->

              <!-- The datasource is deployed as WEB-INF/greeter-quickstart-ds.xml,

                  you can find it in the source at src/main/webapp/WEB-INF/greeter-quickstart-ds.xml -->

              <jta-data-source>java:jboss/datasources/GreeterQuickstartDS</jta-data-source>

              <properties>

                  <!-- Properties for Hibernate -->

                  <property name="hibernate.hbm2ddl.auto" value="create-drop" />

                  <property name="hibernate.show_sql" value="false" />

              </properties>

          </persistence-unit>

       

      Thanks for any info and help.