I'm developing a project with ScalaFX and MySQL database.
SBT successfully added MySQL connector via build.sbt
file. When it compiles the project, it stops with a type mismatch error:
[error] found : com.aitrich.scalafx.test.DbConnection.type (with underlying type object com.aitrich.scalafx.test.DbConnection)
[error] required: com.aitrich.scalafx.test.DbConnection
[error] val orders: Seq[Person] = OrderDao.getAllOrders(dbc)
[error] ^
[error] one error found
[error] (compile:compile) Compilation failed
[error] Total time: 14 s, completed Nov 14, 2013 12:04:06 PM
The following is a code snippet from the main method:
var dbc = DbConnection
val orders: Seq[Person] = OrderDao.getAllOrders(dbc)
This is the DbConnection
case class:
case class DbConnection() {
def getConnectionString =
"jdbc:mysql://%s:3306/simpleorder?user=%root&password=%sa".
format("localhost","root","sa")
}
Why does compile
fail?