我在我的项目中使用 postgresql 9.1-901.jdbc4,我配置它是这样的:
构建.scala:
import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "project_name"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
"postgresql" % "postgresql" % "9.1-901.jdbc4"
)
val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
// Add your own project settings here
)
}
应用程序.conf
db.default.driver=org.postgresql.Driver
db.default.url="jdbc:postgresql://localhost:5432/project_name"
db.default.user=postgres
db.default.password=mypw
db.default.partitionCount=1
db.default.maxConnectionsPerPartition=5
db.default.minConnectionsPerPartition=5
然后我在使用时使用了以下组合:
play clean
play compile
play eclipsify
play ~run
或者,您可以play dependencies
在此之后键入以查看其是否正确加载。