OpenShift - Tomcat 7 (JBoss EWS 2.0) + PostgreSQL 9.2 + Hibernate 4.3.5

89 views Asked by At

I am trying to setup Hibernate 4.3.5 on my web app. I need help on how to configure Hibernate to work with RedHat OpenShift. My configuration is as follows:

  • RedHat OpenShift
  • Tomcat 7 (JBoss EWS 2.0)
  • PostgreSQL 9.2
  • Hibernate 4.3.5

The data source is setup with default in context.xml

<Resource name="jdbc/PostgreSQLDS" url="jdbc:postgresql://${OPENSHIFT_POSTGRESQL_DB_HOST}:${OPENSHIFT_POSTGRESQL_DB_PORT}/${OPENSHIFT_APP_NAME}"
      driverClassName="org.postgresql.Driver"
      username="${OPENSHIFT_POSTGRESQL_DB_USERNAME}"
      password="${OPENSHIFT_POSTGRESQL_DB_PASSWORD}"
      auth="Container"
      type="javax.sql.DataSource"
      maxActive="20"
      maxIdle="5"
      maxWait="10000"/>

To get everything up and running I want to have a simple setup running. I have a database table that needs to be mapped to a Hibernate Java class with similar properties. The table is created as follows:

create table names (
    id      int,
    first   varchar(50),
    last    varchar(50) 
);

Which configuration files are required to bind them up and where should they be located in the OpenShift setup?

Any help is appreciated.

0

There are 0 answers