There are many databases in the world, and if your database has a functional JDBC
driver, it potentially could work with Rails. Adding this support is easy indeed. First of all, you
should try and see if your database works with AR-JDBC without changing anything. Say you
want support for FooDB, which has a JDBC driver called org.foo.db.Driver. Just write the configuration
for it and try it with Rails. If you??™re lucky, it will just work:
development:
adapter: jdbc
driver: org.foo.db.Driver
url: jdbc:foodb://localhost/?db=ar_test
username: ar_user
password: ar_pass
If you??™re not lucky, you??™ll need to add some parts to AR-JDBC. You won??™t have to modify
the source code for AR-JDBC to effect changes in it, though. However, to be able to make good
changes, it will help you to see how the other databases have been implemented, so go to
http://rubyforge.org/projects/jruby-extras and from there on find your way to the most
recent AR-JDBC source code. If you want some more information on this, take a look in
Chapter 15 where I describe some more about what??™s needed to support new databases to
AR-JDBC. You can find the support for the different databases in lib/jdbc_adapter/. The
added support is divided into two different parts: Column and Adapter. Possibly, you won??™t
have to add code for both, but we??™ll just assume that for now. If your code works well, you??™ll
probably want to publish it somewhere, but for now you??™ll develop the code in the lib directory
of a Rails application.
Pages:
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178