<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>Nick Sieger: ActiveRecord JDBC adapter as Rails plugin</title>
  <id>tag:blog.nicksieger.com,2005:Typo</id>
  <generator uri="http://www.typosphere.org" version="4.0">Typo</generator>
  <link rel="self" type="application/atom+xml" href="http://blog.nicksieger.com/xml/atom10/article/30/feed.xml"/>
  <link rel="alternate" type="text/html" href="http://blog.nicksieger.com/articles/2006/06/26/activerecord-jdbc-adapter-as-rails-plugin"/>
  <updated>2007-08-31T17:25:43+00:00</updated>
  <entry>
    <author>
      <name>Nick</name>
    </author>
    <id>urn:uuid:33bd024e-6a0a-497a-ae03-9f71efc7d74b</id>
    <published>2006-09-08T16:31:14+00:00</published>
    <updated>2007-08-31T17:25:43+00:00</updated>
    <title>Comment on ActiveRecord JDBC adapter as Rails plugin by Nick</title>
    <link rel="alternate" type="text/html" href="http://blog.nicksieger.com/articles/2006/06/26/activerecord-jdbc-adapter-as-rails-plugin#comment-55"/>
    <content type="html">&lt;p&gt;Yes, you do.  I appear to have mixed usages of Ruby a little too much in the article.  Try it with JRuby, or better yet, follow along with &lt;a href='http://ola-bini.blogspot.com/2006/09/activerecord-jdbc-020.html' rel="nofollow"&gt;more&lt;/a&gt; &lt;a href='http://headius.blogspot.com/2006/09/using-activerecord-jdbc-adapter.html' rel="nofollow"&gt;recent&lt;/a&gt; howtos on using the AR-JDBC adapter.  Have fun!&lt;/p&gt;</content>
  </entry>
  <entry>
    <author>
      <name>Hasan</name>
    </author>
    <id>urn:uuid:a147d7ec-c4f8-4382-9372-059f889c12d2</id>
    <published>2006-09-07T22:20:25+00:00</published>
    <updated>2007-08-31T17:25:41+00:00</updated>
    <title>Comment on ActiveRecord JDBC adapter as Rails plugin by Hasan</title>
    <link rel="alternate" type="text/html" href="http://blog.nicksieger.com/articles/2006/06/26/activerecord-jdbc-adapter-as-rails-plugin#comment-53"/>
    <content type="html">&lt;p&gt;I&amp;#8217;m trying to use this adapter with rails (rev. 5505). I put in &amp;#8220;adapter: jdbc&amp;#8221; into config/database.yml; I get &amp;#8220;no such file to load &amp;#8211; java&amp;#8221; from rake. There&amp;#8217;s no gem named java either. The jvm is on my path. Do I need to install jruby?&lt;/p&gt;</content>
  </entry>
  <entry>
    <author>
      <name>Manyi Lu</name>
    </author>
    <id>urn:uuid:b8046a40-a1ea-4a76-af7e-99adb64d87f3</id>
    <published>2006-08-17T13:52:03+00:00</published>
    <updated>2007-08-31T17:25:41+00:00</updated>
    <title>Comment on ActiveRecord JDBC adapter as Rails plugin by Manyi Lu</title>
    <link rel="alternate" type="text/html" href="http://blog.nicksieger.com/articles/2006/06/26/activerecord-jdbc-adapter-as-rails-plugin#comment-49"/>
    <content type="html">&lt;p&gt;A JDBC adapter is very useful.&lt;/p&gt;

&lt;p&gt;If you are going to test with additional databases, Java DB or Apache Derby is a good choice, it runs in both embedded and client server mode. Java DB actually comes with jdk1.6.&lt;/p&gt;</content>
  </entry>
  <entry>
    <author>
      <name>Nick Sieger</name>
    </author>
    <id>urn:uuid:698d3238-c164-45fd-a7c4-0c07199a71df</id>
    <published>2006-06-26T17:53:00+00:00</published>
    <updated>2007-08-31T17:25:40+00:00</updated>
    <title>ActiveRecord JDBC adapter as Rails plugin</title>
    <link rel="alternate" type="text/html" href="http://blog.nicksieger.com/articles/2006/06/26/activerecord-jdbc-adapter-as-rails-plugin"/>
    <category term="ruby" label="ruby" scheme="http://blog.nicksieger.com/articles/category/ruby"/>
    <category term="rails" label="rails" scheme="http://blog.nicksieger.com/articles/category/rails"/>
    <category term="java" label="java" scheme="http://blog.nicksieger.com/articles/category/java"/>
    <content type="html">&lt;p&gt;I&amp;#8217;ve got things set up in my svn repo such that you pull down my
ActiveRecord JDBC adapter as a Rails plugin.  Although it appears that
using &amp;#8216;script/plugin&amp;#8217; inside of JRuby may have some issues.  So for
now, use C Ruby.  Inside your Rails app, do:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;ruby script/plugin install http://svn.caldersphere.net/svn/main/activerecord-jdbc/trunk/activerecord_jdbc/&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This should pull down and configure the JDBC adapter for you with no
additional setup.  If it doesn&amp;#8217;t, let me know and we&amp;#8217;ll work through
it.  I haven&amp;#8217;t yet tried running a Rails app inside of JRuby yet but I
hope to in the next couple of days.&lt;/p&gt;

&lt;p&gt;I am also starting to investigate testing with another database,
hsqldb.  I think the driver could benefit from attempting to use some
additional databases, if we&amp;#8217;re ever going to fulfill the promise of
leveraging any JDBC data source, and also I think it would be cool to
use an embedded database in the spirit of SQLite which has become
popular with smaller Rails apps in C Ruby-based Rails land.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Update:&lt;/em&gt; it turns out you can&amp;#8217;t easily install a new ActiveRecord adapter as a Rails plugin at this point with out some extra finagling, because of the way &lt;code&gt;Rails::Initializer&lt;/code&gt; initializes the database before any of the plugins.  For now, I&amp;#8217;ve got the plugin set up to re-initialize all of the ActiveRecord infrastructure, so in order to use the JDBC adapter plugin, you&amp;#8217;ll need to add the following to your &lt;code&gt;config/environment.rb&lt;/code&gt;.  Note that you&amp;#8217;re not &amp;#8220;skipping&amp;#8221; ActiveRecord, just initializing it later.&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;  &lt;span class="comment"&gt;# Skip frameworks you're not going to use&lt;/span&gt;
  &lt;span class="ident"&gt;config&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;frameworks&lt;/span&gt; &lt;span class="punct"&gt;-=&lt;/span&gt; &lt;span class="punct"&gt;[&lt;/span&gt;&lt;span class="symbol"&gt;:active_record&lt;/span&gt;&lt;span class="punct"&gt;]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content>
  </entry>
</feed>
