<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>Nick Sieger: Category java</title>
  <subtitle type="html">do what you love</subtitle>
  <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/category/java/feed.xml"/>
  <link rel="alternate" type="text/html" href="http://blog.nicksieger.com/articles/category/java"/>
  <updated>2007-08-31T17:25:40+00:00</updated>
  <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>
  <entry>
    <author>
      <name>Nick Sieger</name>
    </author>
    <id>urn:uuid:a41e4385-8403-4baf-b382-bff2382ece22</id>
    <published>2006-07-27T14:57:00+00:00</published>
    <updated>2007-08-31T18:00:34+00:00</updated>
    <title>Why does an array index start at 0, not 1</title>
    <link rel="alternate" type="text/html" href="http://blog.nicksieger.com/articles/2006/07/27/why-does-an-array-index-start-at-0-not-1"/>
    <category term="random" label="random" scheme="http://blog.nicksieger.com/articles/category/random"/>
    <category term="qotd" label="qotd" scheme="http://blog.nicksieger.com/articles/category/qotd"/>
    <category term="java" label="java" scheme="http://blog.nicksieger.com/articles/category/java"/>
    <content type="html">&lt;p&gt;If you were looking for an answer to this question, you apparently cannot get a straight one in the &lt;a href="http://forum.java.sun.com/thread.jspa?threadID=357877&amp;amp;start=0&amp;amp;tstart=0"&gt;java forums&lt;/a&gt;.  Just one of many choice quotes:&lt;/p&gt;

&lt;blockquote&gt;
    &lt;blockquote&gt;
        &lt;p&gt;Anyway, any logically counting would start at 0.&lt;/p&gt;
    &lt;/blockquote&gt;
    
    &lt;p&gt;I tried that once. I referred to my son as &amp;#8220;Number Zero Son&amp;#8221;. Got a definitely negative response.&lt;/p&gt;
&lt;/blockquote&gt;</content>
  </entry>
  <entry>
    <author>
      <name>Nick Sieger</name>
    </author>
    <id>urn:uuid:eea101ac-a937-4482-b25c-5c2286f01f6d</id>
    <published>2006-09-08T15:11:00+00:00</published>
    <updated>2007-08-31T22:33:24+00:00</updated>
    <title>JRuby and Sun</title>
    <link rel="alternate" type="text/html" href="http://blog.nicksieger.com/articles/2006/09/08/jruby-and-sun"/>
    <category term="ruby" label="ruby" scheme="http://blog.nicksieger.com/articles/category/ruby"/>
    <category term="java" label="java" scheme="http://blog.nicksieger.com/articles/category/java"/>
    <category term="jruby" scheme="http://blog.nicksieger.com/articles/tag/jruby"/>
    <content type="html">&lt;p&gt;The noise &lt;a href="http://www.bloglines.com/search?q=jruby&amp;amp;ql=en&amp;amp;s=f&amp;amp;pop=l&amp;amp;news=m"&gt;is&lt;/a&gt; &lt;a href="http://technorati.com/search/jruby"&gt;deafening&lt;/a&gt; by now, but I&amp;#8217;m feeling the desire to chime in publicly with my congratulations and support for &lt;a href="http://headius.blogspot.com/2006/09/jruby-steps-into-sun.html"&gt;Charlie&lt;/a&gt; and &lt;a href="http://www.bloglines.com/blog/ThomasEEnebo?id=19"&gt;Tom&lt;/a&gt;.  JRuby has come a long way in the past six months, and this is strong validation of that fact.&lt;/p&gt;

&lt;p&gt;As I &lt;a href="/articles/2006/05/15/jruby-on-rails-and-activerecord-on-jdbc"&gt;hinted back in May&lt;/a&gt;, this is getting big, and it&amp;#8217;s been a pleasure to have been on the JRuby train!  The future is bright for Ruby and Java the platform, and JRuby is leading the way.&lt;/p&gt;</content>
  </entry>
  <entry>
    <author>
      <name>Nick Sieger</name>
    </author>
    <id>urn:uuid:be1363d9-dfe0-443e-8248-93aa31622820</id>
    <published>2007-09-14T05:33:00+00:00</published>
    <updated>2007-09-15T00:53:21+00:00</updated>
    <title>Gig: Speaking at RailsConf Europe 2007</title>
    <link rel="alternate" type="text/html" href="http://blog.nicksieger.com/articles/2007/09/14/gig-speaking-at-railsconf-europe-2007"/>
    <category term="java" label="java" scheme="http://blog.nicksieger.com/articles/category/java"/>
    <category term="rails" scheme="http://blog.nicksieger.com/articles/tag/rails"/>
    <category term="railsconf" scheme="http://blog.nicksieger.com/articles/tag/railsconf"/>
    <category term="gig" scheme="http://blog.nicksieger.com/articles/tag/gig"/>
    <content type="html">&lt;p&gt;Speaking of keeping busy, &lt;a href="http://www.railsconfeurope.com/cs/railseurope2007/view/e_sess/14961"&gt;I&amp;#8217;ll be speaking&lt;/a&gt; alongside my colleague &lt;a href="http://blogs.sun.com/craigmcc/" title="Craig McClanahan's Weblog"&gt;Craig McClanahan&lt;/a&gt; at &lt;a href="http://www.railsconfeurope.com/" title="RailsConf Europe 2007 &amp;#8226; September 17, 2007 - September 19, 2007 &amp;#8226; Berlin, Germany"&gt;RailsConf Europe &lt;/a&gt; in Berlin next week.&lt;/p&gt;

&lt;p&gt;Sun is a Diamond Sponsor at RailsConf again, just like in Portland last May. Part of that sponsorship money pays for a brief keynote spot (filled by Craig) as well as a session or two. So no, I didn&amp;#8217;t get my spot through an accepted proposal submission, but that doesn&amp;#8217;t mean that the session is going to be a big &lt;a href="http://headius.blogspot.com/2007/09/infoworld-bossies-close-to-my-heart.html"&gt;marketing shill&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;No, actually Craig and I are part of a small group at Sun that&amp;#8217;s embracing Rails in a big way, and we&amp;#8217;re going to be launching a site built mostly on Rails later this fall. We&amp;#8217;re taking what we think are some novel approaches to building a Rails-based application and we thought we&amp;#8217;d share some of those thoughts with you rather than drone on for the session about how great Sun is and what snazzy tools we make. (Although expect to see a subtle plug or two for Sun hardware and tools. Call it product placement rather than overt selling.)&lt;/p&gt;

&lt;p&gt;I titled the session &amp;#8220;Rails Hydra&amp;#8221; because the central idea of the structure of our application is not one Rails app, but many. The UI and views don&amp;#8217;t even talk to a database; instead they make use of ActiveResource and RESTful web services, talking to the models living in other Rails applications in the backend. One key point is we&amp;#8217;re deploying .war files to JRuby running on Glassfish, thus avoiding headaches of morbidly multiplying Mongrel math. We&amp;#8217;ll elaborate on this arrangement and talk about some of the other tools and tricks we&amp;#8217;re using.&lt;/p&gt;

&lt;p&gt;Also, Charlie, Tom and Ola will be there, so we&amp;#8217;ll certainly have a JRuby summit at some point. Stop by and say hello!&lt;/p&gt;</content>
  </entry>
</feed>
