I'm trying to build a to-do list using play. Now the issue I'm having, is that I can't seem to use the SQL format Date in my parser.

package models import java.sql.Date import anorm.SqlParser._ import anorm._ import org.joda.time.DateTime import play.api.Play.current import play.api.db.DB case class Task( id:Int, task:String, description:String, dueDate:Date ) object Task { val task = { get[Int]("id") ~ get[String]("task")~ get[String]("description")~ get[Date]("dueDate")map { case id~task~description~dueDate => Task(id, task, description, dueDate) } } def all(): List[Task] = DB.withConnection { implicit c => SQL("select * from task").as(task *) } def create(task: String, description: String, dueDate:Date): Unit = { DB.withConnection { implicit c => SQL("insert into task(task, description, dueDate) values ({task},{description},{dueDate})") .on( 'task -> task, 'description -> description, 'dueDate -> dueDate ).executeUpdate() } } def delete(id: Int) { DB.withConnection { implicit c => SQL("delete from task where id = {id}") .on('id -> id).executeUpdate() } } }

getDate throws me the following error:

could not find implicit value for parameter extractor: anorm.Column[java.sql.Date]

When I change SQL Date to util Date, it'll whine that SQL Date is expected. The parameter dueDate should become the SQL column whith custom dates as input.

How do I fix this? Is it even possible to use java.sql.date in Scala?

(Im using h2-db for my SQL)

If you need more info, leave a hint.