ScalaFX と MySQL データベースを使用してプロジェクトを開発しています。
SBT はbuild.sbt
ファイル経由で MySQL コネクタを正常に追加しました。プロジェクトをコンパイルすると、型の不一致エラーで停止します。
[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
以下は、メイン メソッドのコード スニペットです。
var dbc = DbConnection
val orders: Seq[Person] = OrderDao.getAllOrders(dbc)
これはDbConnection
ケースクラスです:
case class DbConnection() {
def getConnectionString =
"jdbc:mysql://%s:3306/simpleorder?user=%root&password=%sa".
format("localhost","root","sa")
}
なぜcompile
失敗するのですか?