package models
import play.api._
import play.api.mvc._
import anorm._
import anorm.SqlParser._
import play.api.db.DB
import play.api.Play.current
import scala.language.postfixOps
case class User(name:String)
object User {
def insert(name:String) : Boolean={
DB.withConnection { implicit connection =>
val result:Boolean= SQL("insert into user(name,username,password) VALUES('"+name+"','"+name+"','"+name+"')").execute()
return result
}
}
}
"In above program an exception is occured named "[Exception: DB plugin is not registered.]". how to fix it"
In my case the application.conf had invalid connect string to database (after deployment on a different environment). I have changed the db.default.url value in the application.conf.