I'm tinkering with Yet Another Java Bridge
(http://www.cmt.phys.kyushu-u.ac.jp/~M.Sakurai/cgi-bin/fw/wiki.cgi?page=YAJB)
and a JDBC driver. I'm wondering if anyone has tried this and might
have a few examples laying around?
btw, YAJB works very nicely so far. :)
Much thanks!
I'm getting there... here's a working example.
require 'yajb/jbridge'
JBRIDGE_OPTIONS = { :classpath =>
"/Users/jared/work/hypersonic/tinkering/lib/hsqldb.jar"}
include JavaBridge
jimport "java.sql.*"
jimport "org.hsqldb.*"
class_instance = jstatic Class
class_instance.forName("org.hsqldb.jdbcDriver" )
driver_manager = jstatic :DriverManager
conn = driver_manager.getConnection("jdbc:hsqldb:file:testdb", "sa",
"")
statement = conn.createStatement
statement.executeUpdate("CREATE TABLE child(c1 INTEGER, c2 VARCHAR)")
Did you try rjb at all? I'd be interested to know how they compare.
--
Adam Keys
ad...@purediscovery.com
--
"Adam Keys" <ad...@therealadam.com> wrote in message
news:5CB0A76E-F528-472D...@therealadam.com...
The gem failed to compile some native extensions. While looking around to
see what I needed to tell mkmf so it could find jni.h I stumbled across YAJB
and it Just Worked. ;)
I did get an off list ping from someone about the two. RJB uses JNI and YAJB
uses a data stream over a socket, so the performance difference can be
substantial (with RJB w/JNI being much faster). Since I'm on a database
driver, I'm sure I'll end up using RJB...
But I got a skeleton of a database driver running in a day (just to Ruby,
not Active Record) using YAJB. It's really nice once you get your head into
it. I can see where it ~might~ be too slow, but I'm not convinced yet. :)
Jared
http://jaredrichardson.net