When I run my project for the first time during an SBT session, it throws the following exception when trying to access a MySQL database:
java.lang.NoClassDefFoundError: scala/Ordered
When I run it again (and any time after it, during the same SBT session), it throws a different one:
java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost/...
When I was using NetBeans, the same code was working Ok. Now, As I use SBT for building, Kate to edit and manage my project manually, I get these runtime errors.
MySQL JDBC driver (downloaded right from MySQL.com) JAR is in project's lib directory, other libraries I've put there work ok.
in the code I
import java.sql._
...
// read
val dbc : Connection = DriverManager.getConnection("jdbc:mysql://localhost/...")
val st : Statement = dbc.createStatement
val rs : ResultSet = st.executeQuery("SELECT ...")
if(rs.first) result = rs.getDouble("field")
dbc.colse
...
// write
val dbc : Connection = DriverManager.getConnection("jdbc:mysql://localhost/...")
val st : Statement = dbc.createStatement
st.execute("UPDATE ...")
dbc.colse
I've seen a question looking pretty related, but no answer.