Using MySQL with JRuby

For some reason, I had a relatively hard time finding this info all in one spot, so here it is: Using MySQL with JRuby is actually pretty easy (and no annoying arch issues on OS X! :-) Install GEMs (DBI, JDBC driver, DBI adapter): $ jgem install dbi jdbc-mysql dbd-jdbc Then use it! require 'dbi' require 'jdbc/mysql' dbh = DBI.connect('dbi:jdbc:mysql://localhost:3306/test', 'root', '', { "driver" => "com.mysql.jdbc.Driver" } )

February 24, 2010 · 1 min · chetan