Created
February 9, 2013 20:12
-
-
Save jarek-przygodzki/4746892 to your computer and use it in GitHub Desktop.
Howto connect to PostgreSQL DB in Groovy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.sql.Sql | |
def dbUrl = "jdbc:postgresql://localhost/test-db" | |
def dbUser = "test" | |
def dbPassword = "test" | |
def dbDriver = "org.postgresql.Driver" | |
def sql = Sql.newInstance(dbUrl, dbUser, dbPassword, dbDriver) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Grab the Postgres dependencies if you run into
ClassNotFoundException
for the driver: