As said before, which way you choose to go entirely depends on your current resources and requirements
on the end process. However, using JRuby on Rails gives you more options than either Ruby or Java
separately.
This book won??™t be able to give more than a cursory glimpse of how to do online systems that can handle
payments. If that subject interests you, Beginning Ruby on Rails E-Commerceby Christian Hellsten and
Jarkko Laine (Apress, 2006) is the way to go. The information in that book is only about the Ruby way of
doing things, but the concepts should be easy to combine with JRuby.
ActiveRecord and JDBC
As mentioned in Chapter 2, which described what software you would need to install to follow
along in this book, the component that makes it possible to use Java JDBC drivers within Rails
is called ActiveRecord-JDBC, or AR-JDBC for short. In regular Rails applications, there??™s the
concept of an adapter. In Rails, each adapter is specific for one database, so there??™s a MySQL
adapter, an Oracle adapter, and so on. At the moment, there are few adapters that ship with
ActiveRecord. This is also one of the major selling points for JRuby on Rails. Because AR-JDBC
is implemented as an adapter, and that adapter can use any JDBC driver you??™d like, it means
that many more databases will be available for use with Rails.
All is not that easy, though. The JDBC adapter in AR-JDBC is written to be as generic as
possible, but there are still problems with how Rails connects to the database that make it necessary
to tweak the adapter in different ways, depending on which database will be used.
Pages:
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171