Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

YAJB and JDBC?

1 view
Skip to first unread message

jared.r.r...@gmail.com

unread,
Sep 1, 2006, 7:11:54 AM9/1/06
to
Hi all,

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!

Jared
http://jaredrichardson.net

jared.r.r...@gmail.com

unread,
Sep 1, 2006, 9:40:26 AM9/1/06
to

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)")

Adam Keys

unread,
Sep 1, 2006, 11:35:26 AM9/1/06
to
On Sep 1, 2006, at 6:15 AM, jared.r.r...@gmail.com wrote:
> 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. :)
>

Did you try rjb at all? I'd be interested to know how they compare.

--
Adam Keys
ad...@purediscovery.com


Jared Richardson

unread,
Sep 1, 2006, 8:25:11 PM9/1/06
to

--

"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


0 new messages