From: Ken Bloom Date: 2007-12-06T00:40:03+09:00 Subject: Re: What is the best way to interact with a JDBC database On Mon, 03 Dec 2007 17:51:59 -0500, Venks wrote: > Note: parts of this message were removed by the gateway to make it a > legal Usenet post. > > Hi, > > I have a database that has only JDBC connectivity but I need to interact > to this database from Ruby. What's the best way to do so? All ideas and > suggestions are welcome. > > My initial thought is to create a Java program that accepts connection > information and a SQL statement and execute the SQL against the > database. Assuming that I have this program, what's the best way to call > this Java program from Ruby? > > I looked at JRuby and didn't feel that's the right answer. Well, if you're going to have Ruby call a Java program and you can't port the whole thing over to JRuby, you should consider running a DRb server in JRuby to access the database, and access that from a native ruby DRb client. I think (hope) you should be able to expose the JDBC objects you need having to code any special wrappers for them. --Ken (I have never programmed this kind of arrangement before, so I don't know what JRuby can or can't do. This is just speculation.) -- Ken (Chanoch) Bloom. PhD candidate. Linguistic Cognition Laboratory. Department of Computer Science. Illinois Institute of Technology. http://www.iit.edu/~kbloom1/