Re: Which Java persistence library would you use with PostgreSQL?

From: Sumit Raja <sumit(dot)raja(at)raja-consulting(dot)co(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Which Java persistence library would you use with PostgreSQL?
Date: 2012-05-02 11:09:20
Message-ID: CAB4mO2e1LRy+PHAPDoq2yuLvB_yc5p-j=rQp2NmJUoi+7s-hhg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> <property name="hibernate.connection.url"
> value="jdbc:postgresql://localhost:5432/MySampleDb"/>
>
> If you add ";create=true" just as in the example above, it breaks the code
> and you get this as a result:
>
> org.postgresql.util.PSQLException: FATAL: database "MySampleDb;create=true"
> does not exist

"create=true" is a Derby specific instruction to create the database
if it is missing., it means nothing to the Postgres driver which
rightly assumes it is the name of the database you are trying to
connect to. To create tables using Hibernate you need to set up your
Hibernate config to create the schema for you. The Hibernate docs will
give you more information - for 3.x have a look at
http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/session-configuration.html#configuration-optional.

If that doesn't help, maybe the Hibernate user group is better placed
to give you more information?

- Sumit

In response to

Browse pgsql-general by date

  From Date Subject
Next Message STERBECQ Didier 2012-05-02 11:39:24 RE : Postgres 8.x on Linux : how to use HugePages
Previous Message Bata Degen 2012-05-02 10:42:03 Re: Which Java persistence library would you use with PostgreSQL?