# YAJB and JDBC?

**URL:** <https://www.ruby-forum.com/t/yajb-and-jdbc/67226>\
**Category:** Ruby\
**Created:** [September 1, 2006, 1:20pm UTC](https://www.ruby-forum.com/t/yajb-and-jdbc/67226 "2006-09-01T13:20:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 1, 2006, 1:20pm UTC](https://www.ruby-forum.com/t/yajb-and-jdbc/67226/1 "2006-09-01T13:20:02Z")

</div>

Hi all,

I’m tinkering with Yet Another Java Bridge  
([Software Error](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](http://jaredrichardson.net)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 1, 2006, 3:50pm UTC](https://www.ruby-forum.com/t/yajb-and-jdbc/67226/2 "2006-09-01T15:50:24Z")

</div>

removed\_email\_address@domain.invalid wrote:

> Jared  
> [http://jaredrichardson.net](http://jaredrichardson.net)

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

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 1, 2006, 6:08pm UTC](https://www.ruby-forum.com/t/yajb-and-jdbc/67226/3 "2006-09-01T18:08:52Z")

</div>

On Sep 1, 2006, at 6:15 AM, removed\_email\_address@domain.invalid wrote:

> I’m tinkering with Yet Another Java Bridge  
> ([Software Error](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.
