JDBC Helpers for JRuby
The classes in this library are intended to assist in interacting with JDBC databases when programming in JRuby.
This should work with any JDBC database, but it has only been tested with:
gem install jdbc-helpers
Note that you will need to include a JDBC driver into the current namespace before these methods will work:
require_relative 'sqlite-jdbc-18.104.22.168.jar' java_import 'org.sqlite.JDBC'
From there you can use the classes in this library:
Create a connection object...
conn = ::.('jdbc:sqlite:memory', '', '').
...then you can use the connection to do other things:
::.( conn, "create table test(a integer, b varchar(15), c timestamp, d date);" ) ::.( conn, "insert into test values(12345,'chicken','2016-07-01T23:23:23.000','2016-07-01');" ) ::.( conn, "insert into test values(12346,'turkey','2016-07-01T23:23:23.000','2016-07-01');" )
Note that you can use a connection object created without this gem if desired.