Postgresql 如何使用web应用程序和Jetty Runner连接到数据库?
我有一个postgresql数据库,需要使用Jetty Runner将其连接到我的web应用程序(在Grails中创建)。最简单的方法是什么?在Postgresql 如何使用web应用程序和Jetty Runner连接到数据库?,postgresql,grails,jdbc,jetty,jndi,Postgresql,Grails,Jdbc,Jetty,Jndi,我有一个postgresql数据库,需要使用Jetty Runner将其连接到我的web应用程序(在Grails中创建)。最简单的方法是什么?在grails-app/conf/DataSource.groovy中为grails-app指定数据库(JDBC)设置。对于postgres数据库,您将需要以下内容: dataSource { pooled = true driverClassName = "org.postgresql.Driver" username = "us
grails-app/conf/DataSource.groovy
中为grails-app指定数据库(JDBC)设置。对于postgres数据库,您将需要以下内容:
dataSource {
pooled = true
driverClassName = "org.postgresql.Driver"
username = "user1258361"
password = "lmgtfy"
url = "jdbc:postgresql:user1258361"
// one of 'create', 'create-drop','update'
// if you don't know what this does, find out now!!!
dbCreate = "update"
}
您需要用我上面提供的伪值替换真实的数据库URL、用户名和密码