title: sybase from ruby: JDBC connection to Sybase
body: <p>I need to connect to a fairly old Sybase database from Ruby.</p>
  
  <p>I ended up using jRuby, only because I couldn't get any manner of connecting to Sybase from MRI to work; If there's a way that actually works and isn't crazy to set up a Sybase connection for an old-ish version of Sybase, that'd be great. But, I beat my head against the wall on that one for a while, I think there is not. </p>
  
  <p>So I wound up in jRuby, in order to use JDBC. I do have a JDBC.jar file that works to connect to Sybase. </p>
  
  <p>I know I <em>can</em> write raw JDBC code in jRuby, just as I would in Java, using the JDBC API. But the JDBC API is such a bear to work with, among other things being very poor at escaping/injection-protecting (or maybe I just don't understand how to use it right, see 'difficult to work with', at least for me). </p>
  
  <p>Are there Ruby 'wrapper' libraries that will work in jRuby as a wrapper for an arbitrary JDBC?  If I could get it to work with ActiveRecord, that might be cool, but not neccesarily actually required. </p>
  
  <p>I had been using the Ruby 'DBI' package, which was actually working great. But the Ruby DBI package seems to be unmaintained and is becoming increasingly difficult for me to use; there are a bunch of pull requests (https://github.com/erikh/ruby-dbi/issues) related to making it work under 1.9.3, silencing deprecation warnings, etc. Which are not being attended to by committers. I emailed the github project owner to ask if there was any chance of them being attended to, and received a one-word answer "No", with no explanation. Not really sure what's going on. </p>
  
  <p>So, what are my options for connecting to Sybase from Ruby, with jRuby JDBC or other?</p>
  
  <p>(Per demand below, I'll add that I use RHEL 5 as an OS. But if the answer is "once you get FreeTDS installed, you can do X, Y, and Z like this", I can probably manage to get FreeTDS installed myself. In the past, I've gotten stumped even AFTER getting FreeTDS installed on the host). </p>