Skip to content

Instantly share code, notes, and snippets.

@simonkro
Created November 26, 2015 14:32
Show Gist options
  • Save simonkro/8c639b190cd764c97a6b to your computer and use it in GitHub Desktop.
Save simonkro/8c639b190cd764c97a6b to your computer and use it in GitHub Desktop.
Absolute minimal mysql and jooq test
name := "mysqltest"
version := "1.0"
scalaVersion := "2.10.6"
libraryDependencies += "org.jooq" % "jooq" % "3.7.1"
libraryDependencies += "org.jooq" % "jooq-scala" % "3.7.1"
libraryDependencies += "mysql" % "mysql-connector-java" % "5.1.37"
import java.sql.DriverManager
import org.jooq._
object Test {
def main(args: Array[String]): Unit = {
Class.forName("com.mysql.jdbc.Driver")
val c = DriverManager.getConnection("jdbc:mysql://localhost:3306", "root", "foo")
val e = impl.DSL.using(c, SQLDialect.MYSQL)
println(e.select().from("cms_db_test.countries").fetch())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment