我剛開始玩的工作,而且我修改我在做一個SQL讀,現在我得到下面的錯誤方式:DB插件不在場上註冊2.0
[Exception: DB plugin is not registered.]
的代碼我對這個班是:
package models
import play.api.db._
import play.api.Play.current
import anorm._
case class Housing(id: Long, rent: String, address: String, street0: String, street1: String, neighbourhood: String)
object Housing {
def all(): List[Housing] = DB.withConnection { implicit c =>
SQL("select * from housing")().map { row =>
Housing(row[Long]("id"), row[String]("rent"), row[String]("address"), row[String]("street0"),
row[String]("street1"), row[String]("neighbourhood"))
}.toList
}
def create(rent: String, address: String, street0: String, street1: String, neighbourhood: String) {}
def delete(id: Long) {}
}
我不知道這甚至要做到這一點的最好辦法,但使用〜連鎖好像我剛剛結束了複製了一堆東西。
+1這只是發生在我身上 – 2012-03-28 10:20:59
我有同樣的問題。我忘了取消註釋這一個db.default.driver。 – 2013-02-13 20:05:29
我根本沒有這條線 – ses 2013-06-28 02:44:47