所以现在我终于决定试一试,我坚持第一个例子。
http://slick.typesafe.com/doc/1.0.1/gettingstarted.html#populating-the-database
在指南中,以下代码用于连接 H2 数据库:
import scala.slick.driver.H2Driver.simple._
import Database.threadLocalSession
Database.forURL("jdbc:h2:mem:test1", driver = "org.h2.Driver") withSession {
// The session is never named explicitly. It is bound to the current
// thread as the threadLocalSession that we imported
}
我只是不明白是什么Database
。它是我可以在某处下载的库吗?在哪里?
请给我生锈的轮子上油,这样我就可以滑溜溜地滚动了!