From: Michael Davis Date: 2004-02-24T07:04:48+09:00 Subject: Re: Calling JDBC from with Ruby Sean Russell wrote: > Michael Davis wrote in message news:... > >>No. The data that I need to access may not always be relational and I have >>been given specific requirements for using both JDBC and ODBC. I explored >>many possible options for accessing data with my client and they have several >>very good reasons for these requirements. > > > Are you trying to cheat? The only reason I can think of for > *requiring* an application to use JDBC is to be obtuse about > *requiring* the application to be written in Java. > > However silly your requirements may sound, it seems to me as if you > have four options: > > 1) Write a dumb Java application that takes two arguments: a JDBC > connection string, and a SQL string. Then have it execute the query > and dump the results as a [CT]SV and have your Ruby application invoke > the Java app to get the data. This is really, really stupid. > 2) Use JRuby to execute your application. Then you can access the > JDBC API from within Ruby. This is a better solution, but your > application will be that much slower, and you'll have to be careful > about the places where JRuby is incomplete. > 3) Implement (1), but secretly, and obtusely, use the Ruby DBI > interface. > 4) Shoot the person who gave you that requirement, because it is > utterly stupid*. > > > > * I can think of only one case in which you *have* to use JDBC, and > that would be where you happen to have a JDBC connector for a > database, and one doesn't exist for DBI. Improbable, but possible. > > --- SER 1) I hadn't considered this possibility. Thanks for suggesting it. 2) I am considering this possibility but I have some reservations in addition to the ones you mention. 3) I am not even going to consider this option, it's an integrity thing. I am always up front with my clients about how things are implemented. 4) Is it wise to to jump to such a conclusion without first fully understanding all of the reasons for such a requirement? I understand my clients need for JDBC and while it may not make since given the limited information I have provided, it does make a lot of since to my client. May I lovingly add, that criticism about my clients requirement(s) is not really very helpful. I have a requirement and I intend to satisfy all of the requirements. I am looking for a solution not reasons why I shouldn't do it. Thanks, Michael