Friday, April 25, 2014

PostgreSQL configuration on Grails

How to : configure PostgreSQL on Grails
http://stackoverflow.com/questions/11535537/how-to-config-postgresql-to-grails-application

  • Download the driver from http://jdbc.postgresql.org/download.html and copy it to the lib diretory of your project.
  • Add to DataSource.groovy

dataSource {
pooled = true
driverClassName = "org.postgresql.Driver"
dialect = "org.hibernate.dialect.PostgreSQLDialect"
username = "username"
password = "password"
}
development {
dataSource {
dbCreate = "update" // one of 'create', 'create-drop', 'update', 'validate', ''
url = "jdbc:postgresql://localhost:5432/postgres"
}
}

No comments: