title: How to use MySQL JDBC driver in an SBT Scala project?
body: <p>When I run my project for the first time during an SBT session, it throws the following exception when trying to access to a MySQL database:</p>
  
  <blockquote>
    <p>java.lang.NoClassDefFoundError: scala/Ordered</p>
  </blockquote>
  
  <p>When I run it again (and any time after it, during the same SBT session), it throws a different one:</p>
  
  <blockquote>
    <p>java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost/...</p>
  </blockquote>
  
  <p>When I was using NetBeans, the same code was working Ok. Now, As I use SBT for building and Kate to edit and manage my project manually, I get these runtime errors.</p>
  
  <p>MySQL JDBC driver (downloaded right from MySQL.com) JAR is in project's lib directory and all the other libraries I've put there work ok.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>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.close
  ...
  // write
  val dbc : Connection = DriverManager.getConnection("jdbc:mysql://localhost/...")
  val st : Statement = dbc.createStatement
  st.execute("UPDATE ...")
  dbc.close
  </code></pre>
  
  <p>I've seen a <a href="http://groups.google.com/group/simple-build-tool/browse_thread/thread/c1b69d6a3aeeee60?pli=1" rel="noreferrer">question</a> that looks pretty related, but still no answer.</p>