From: vasudevram Date: 2007-05-29T23:25:04+09:00 Subject: Re: Which ODBC? On May 29, 3:09 pm, "Ronald Fischer" wrote: > Hello, > > I am investigating ways to connect my Ruby (non-Rails) application on > Windows > to either MSSQL, MySql or Oracle databases. ODBC seems to be a common > way > for accessing them, so I wonder how to best access ODBC from Ruby. > > Searching on the Web, I found solutions using DBI, or the ODBC Library > athttp://www.ch-werner.de/rubyodbc/. Now I wonder: > > - Are there other alternative ODBC interfaces? > - Are some of them available as gem? Which ones? > - Are there interfaces written in "plain ruby", so that the application > might also run under JRuby? (Of course I can use JDBC on JRuby as an > alternative - I'm here more interested in Ruby vs. JRuby compatibility). > > Any suggestions? > > Ronald > > -- > Ronald Fischer > Phone: +49-89-452133-162 I don't know about the pros and cons of alternative ODBC libraries for Ruby, so can't say anything there. But here are some other ideas: - Why not try out a few of the different ODBC options and evaluate them? And, preferably, post here or put up an article somewhere with your findings, for the benefit of others ? including me :-) I'd appreciate that as I intend to do some work with Ruby/DBI/ODBC. If you don't I'll probably do it myself after a while. - To use the same code in both Ruby and JRuby, if there are no pure- Ruby libraries, you could consider writing a thin wrapper of your own with alternative underlying Ruby/DBI and JRuby/JDBC implementations. I know this would mean writing more code but it might not be all that much, and you'd then have that code to use in other projects as well. The ODBC/DBI/JDBC interfaces/API are all roughly similar, so you might not have too much work to do, plus you could always bypass your own wrapper and call through directly to whichever underlying interface you're really using in a particular app, for any special cases that your wrapper can't handle. Just my 2c ... Vasudev Ram Dancing Bison Enterprises http://www.dancingbison.com http://sourceforge.net/projects/xtopdf