Reputation: 14928
I am using spring-roo, gwt and hibernate to make a website. We are using the in memory database HyperSonic, but I am trying to switch to postgres.
Everything works fine if I used the jdbc3 driver. The only problem is I have to separately execute the CREATE DATABASE
statement outside of hibernate before it will create the tables via [hibernate.hbm2ddl.auto](http://docs.jboss.org/hibernate/core/3.3/reference/en/html/session-configuration.html#configuration-optional)
being set to create. Is their another option I can set to cause hibernate to do the CREATE DATABASE
if necessary?
Upvotes: 0
Views: 1564
Reputation: 10206
Not really. You have to do a CREATE DATABASE
using a template database (normally template1
). The normal sequence of events is:
template1
databaseCREATE DATABASE
newdb;DDL
statements.If you're interested in more information, look in to the specifics of how PostgreSQL completes the CREATE DATABASE
and you'll understand why.
Upvotes: 2