Configuration for your own database server

OpenXava uses Hibernate for persistence, you need to indicate what database are you using in order that Hibernate generates the SQL statements with the correct syntaxt. You can choose any of the supported Hibernate dialects.

JPA entities (OX3 style)

For example, if you want to change from Hypersonic (the default when you create an OpenXava project) to Oracle you have to,
if you are using OX3, edit the file persitence/META-INF/persistence.xml of your project, and change:
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9Dialect"/>

If you wish to make junit test (to test CRUD) or execute the ant task "updateSchema", you also need to modify the persistence unit with this:

<persistence-unit name="junit">
            <property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver"/>
            <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9Dialect"/>
            <property name="hibernate.connection.url" value="jdbc:oracle:thin:@localhost:1521:XE"/>
            <property name="hibernate.connection.username" value="user"/>
            <property name="hibernate.connection.password" value="password"/>

Likewise, if you wish your application database server to manage the user preferences tab (in this case Oracle) you need to modify the file persistence/openxava-hibernate.cfg indicating the correct datasource and dialect:

        <property name="hibernate.connection.datasource">java:comp/env/jdbc/MyApplicationDS</property>
        <property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
        <property name="hibernate.jdbc.use_get_generated_keys">false</property>
        <mapping resource="TabUserPreferences.hbm.xml"/>

No more.

XML components (classic style)

In the other hand, if you are using OX2 you need to copy and paste the file, in the root of your project, to, edit this last file, and change this line:
for this one:
Then edit the file build.xml of your project and change:
<property name="configuration" value="tomcat-hypersonic" />
<property name="configuration" value="tomcat-oracle" />