title: Is there a way to connect to a H2 database from Ruby without JRuby?
body: <p>I'm testing a web application with ruby 1.8.7 and WATiR and I'd like to connect to a H2 database as easily as possible, which I can only find info on JDBC access for. If there's a way to use JRuby to do this from Ruby that is okay, but I need to use Ruby primarily because my WATiR code is written in it and will hopefully remain so.</p>
  
  <p>All possible solutions will be considered but I'm looking for some simplicity because my database knowledge is limited and I need to access the database (read from and write to) from Ruby/WATiR to test against what's displayed on the web front end.</p>
  
  <p>EDIT: I removed some of my ignorance, now I know JDBC is a Java API for DB access, so I'm now looking for any way to connect to a H2 database so that my Ruby/WATiR scripts can access it.</p>
  
  <p><strong>Background</strong>:
  I have some experience with DBI and Sequel gems, and I have Rails installed (so I can start to play with ActiveRecord, mainly), but willing to learn new things to solve this issue.</p>
  
  <p>Let's assume I'm not a great Java coder. I've also never looked into using JRuby before, so I'm not entirely familiar with how it works.</p>
  
  <p><strong>Solution</strong>
  I eventually got the two talking to each other, mainly thanks to Thomas Mueller's answer below. I installed the PostgreSQL ODBC driver, got Sequel working and connected using ODBC. Using Sequel's PG adapter to connect to the H2 PG server causes some Syntax errors that I'm still working on. I have not yet tried DBI to connect, but I will as it may give me greater control of the syntax should I need it. Many thanks also to Jeremy Evans for his help solving a conflict between activerecord-jdbc-adapter and Sequel (pesky pg.rb file in my ruby path), and for managing Sequel. This is not listed as an answer so that I can give credit to those that answered whilst giving feedback to people in the same situation as me.</p>
  
  <p>I have installed pg (not ruby-pg), sequel, dbi, dbd-odbc (plus a manual file fix, you can ask me for details), hoe, and UNinstalled activerecord-jdbc-adapter.</p>