Kev*_*vin 3 postgresql scala jdbc playframework
这是我的postgres版本 postgresql/9.4.1
这是我的游戏版本 addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.4.6")
这是我的 libraryDependencies
libraryDependencies ++= Seq(
jdbc,
cache,
ws,
specs2 % Test,
"postgresql" % "postgresql" % "9.1-901-1.jdbc4"
)
Run Code Online (Sandbox Code Playgroud)
更改版本9.4-1201-jdbc41给出sbt.ResolveException: unresolved dependency: postgresql#postgresql;9.4-1201-jdbc41: not found
这是我的application.conf
db.default.driver=org.postgresql.Driver
# I tried the following combination
#db.default.url="postgres://user:pass@localhost/20160210_scala_play"
# And
db.default.url="jdbc:postgresql://localhost/20160210_scala_play"
db.default.user="user"
db.default.password="pass"
Run Code Online (Sandbox Code Playgroud)
所有结果都是
`Cannot connect to database`
Run Code Online (Sandbox Code Playgroud)
我证实了这一点
psql \list
Run Code Online (Sandbox Code Playgroud)
确实包含
20160210_scala_play
Run Code Online (Sandbox Code Playgroud)
同 user=user password=password
有人可以指点我的方向吗?
默认情况下,postgresql将侦听端口5432.因此,除非您确定您的postgre实例在端口上运行,否则请将80您的JDBC URL更改为:
jdbc:postgresql://localhost:5432/20160210_scala_play
Run Code Online (Sandbox Code Playgroud)
而且,这种依赖性已经解决了我:
"org.postgresql" % "postgresql" % "9.4-1206-jdbc42"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3466 次 |
| 最近记录: |