Nick Sieger: Category java http://blog.nicksieger.com/articles/category/java en-us 40 ActiveRecord JDBC adapter as Rails plugin <p>I&#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 &#8216;script/plugin&#8217; inside of JRuby may have some issues. So for now, use C Ruby. Inside your Rails app, do:</p> <div class="typocode"><pre><code class="typocode_default ">ruby script/plugin install http://svn.caldersphere.net/svn/main/activerecord-jdbc/trunk/activerecord_jdbc/</code></pre></div> <p>This should pull down and configure the JDBC adapter for you with no additional setup. If it doesn&#8217;t, let me know and we&#8217;ll work through it. I haven&#8217;t yet tried running a Rails app inside of JRuby yet but I hope to in the next couple of days.</p> <p>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&#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.</p> <p><em>Update:</em> it turns out you can&#8217;t easily install a new ActiveRecord adapter as a Rails plugin at this point with out some extra finagling, because of the way <code>Rails::Initializer</code> initializes the database before any of the plugins. For now, I&#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&#8217;ll need to add the following to your <code>config/environment.rb</code>. Note that you&#8217;re not &#8220;skipping&#8221; ActiveRecord, just initializing it later.</p> <div class="typocode"><pre><code class="typocode_ruby "> <span class="comment"># Skip frameworks you're not going to use</span> <span class="ident">config</span><span class="punct">.</span><span class="ident">frameworks</span> <span class="punct">-=</span> <span class="punct">[</span><span class="symbol">:active_record</span><span class="punct">]</span></code></pre></div> Mon, 26 Jun 2006 17:53:00 +0000 urn:uuid:698d3238-c164-45fd-a7c4-0c07199a71df Nick Sieger http://blog.nicksieger.com/articles/2006/06/26/activerecord-jdbc-adapter-as-rails-plugin ruby rails java http://blog.nicksieger.com/articles/trackback/30 Why does an array index start at 0, not 1 <p>If you were looking for an answer to this question, you apparently cannot get a straight one in the <a href="http://forum.java.sun.com/thread.jspa?threadID=357877&amp;start=0&amp;tstart=0">java forums</a>. Just one of many choice quotes:</p> <blockquote> <blockquote> <p>Anyway, any logically counting would start at 0.</p> </blockquote> <p>I tried that once. I referred to my son as &#8220;Number Zero Son&#8221;. Got a definitely negative response.</p> </blockquote> Thu, 27 Jul 2006 14:57:00 +0000 urn:uuid:a41e4385-8403-4baf-b382-bff2382ece22 Nick Sieger http://blog.nicksieger.com/articles/2006/07/27/why-does-an-array-index-start-at-0-not-1 random qotd java http://blog.nicksieger.com/articles/trackback/37 JRuby and Sun <p>The noise <a href="http://www.bloglines.com/search?q=jruby&amp;ql=en&amp;s=f&amp;pop=l&amp;news=m">is</a> <a href="http://technorati.com/search/jruby">deafening</a> by now, but I&#8217;m feeling the desire to chime in publicly with my congratulations and support for <a href="http://headius.blogspot.com/2006/09/jruby-steps-into-sun.html">Charlie</a> and <a href="http://www.bloglines.com/blog/ThomasEEnebo?id=19">Tom</a>. JRuby has come a long way in the past six months, and this is strong validation of that fact.</p> <p>As I <a href="/articles/2006/05/15/jruby-on-rails-and-activerecord-on-jdbc">hinted back in May</a>, this is getting big, and it&#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.</p> Fri, 08 Sep 2006 15:11:00 +0000 urn:uuid:eea101ac-a937-4482-b25c-5c2286f01f6d Nick Sieger http://blog.nicksieger.com/articles/2006/09/08/jruby-and-sun ruby java jruby http://blog.nicksieger.com/articles/trackback/54 Gig: Speaking at RailsConf Europe 2007 <p>Speaking of keeping busy, <a href="http://www.railsconfeurope.com/cs/railseurope2007/view/e_sess/14961">I&#8217;ll be speaking</a> alongside my colleague <a href="http://blogs.sun.com/craigmcc/" title="Craig McClanahan's Weblog">Craig McClanahan</a> at <a href="http://www.railsconfeurope.com/" title="RailsConf Europe 2007 &#8226; September 17, 2007 - September 19, 2007 &#8226; Berlin, Germany">RailsConf Europe </a> in Berlin next week.</p> <p>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&#8217;t get my spot through an accepted proposal submission, but that doesn&#8217;t mean that the session is going to be a big <a href="http://headius.blogspot.com/2007/09/infoworld-bossies-close-to-my-heart.html">marketing shill</a>.</p> <p>No, actually Craig and I are part of a small group at Sun that&#8217;s embracing Rails in a big way, and we&#8217;re going to be launching a site built mostly on Rails later this fall. We&#8217;re taking what we think are some novel approaches to building a Rails-based application and we thought we&#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.)</p> <p>I titled the session &#8220;Rails Hydra&#8221; because the central idea of the structure of our application is not one Rails app, but many. The UI and views don&#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&#8217;re deploying .war files to JRuby running on Glassfish, thus avoiding headaches of morbidly multiplying Mongrel math. We&#8217;ll elaborate on this arrangement and talk about some of the other tools and tricks we&#8217;re using.</p> <p>Also, Charlie, Tom and Ola will be there, so we&#8217;ll certainly have a JRuby summit at some point. Stop by and say hello!</p> Fri, 14 Sep 2007 05:33:00 +0000 urn:uuid:be1363d9-dfe0-443e-8248-93aa31622820 Nick Sieger http://blog.nicksieger.com/articles/2007/09/14/gig-speaking-at-railsconf-europe-2007 java rails railsconf gig http://blog.nicksieger.com/articles/trackback/288