我们可以用
Amazon's Redshift driver for Java
build.sbt
(参见
release note
对于当前版本):
resolvers ++= Seq(
"Redsfhit" at "http://redshift-maven-repository.s3-website-us-east-1.amazonaws.com/release"
)
libraryDependencies += "com.amazon.redshift" % "redshift-jdbc42" % "1.2.10.1009"
Slick
dependencies
:
libraryDependencies ++= Seq(
"com.typesafe.slick" %% "slick" % "3.2.3",
"org.slf4j" % "slf4j-nop" % "1.6.4",
"com.typesafe.slick" %% "slick-hikaricp" % "3.2.3"
)
单程
configure the connection with
Slick
包括使用
typesafe config
application.conf
src/main/resources/
用你的
Redhsift
my_redshift {
url = "jdbc:redshift://examplecluster.abc123xyz789.us-west-2.redshift.amazonaws.com:5439/dev"
user = my_user
password = my_password
driver = com.amazon.redshift.jdbc.Driver
connectionPool = disabled
keepAliveConnection = true
}
my_redshift
是您在typesafe配置中选择的根目录):
import slick.jdbc.PostgresProfile.api._
val db: Database = Database.forConfig("my_redshift")