<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>without-brains.net &#187; Derby</title>
	<atom:link href="http://www.without-brains.net/archives/tag/derby/feed" rel="self" type="application/rss+xml" />
	<link>http://www.without-brains.net</link>
	<description>A software developer&#039;s blog</description>
	<lastBuildDate>Thu, 17 Jun 2010 17:34:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Making SQLite 3 work with JRuby and Rails</title>
		<link>http://www.without-brains.net/archives/132</link>
		<comments>http://www.without-brains.net/archives/132#comments</comments>
		<pubDate>Thu, 26 Nov 2009 20:49:19 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ActiveRecord]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Derby]]></category>
		<category><![CDATA[JRuby]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[SQLite]]></category>
		<category><![CDATA[Website]]></category>

		<guid isPermaLink="false">http://www.without-brains.net/?p=132</guid>
		<description><![CDATA[In my previous post I indicated that I am using Ruby on Rails and JRuby for my new blogging tool. As underlying database I have decided to go with the Rails default: SQLite. SQLite has the advantage that it is an embeddable database, so you don&#8217;t need a separate database server to use it (which [...]]]></description>
			<content:encoded><![CDATA[<p>In my previous post I indicated that I am using <a title="Ruby on Rails" href="http://www.rubyonrails.org">Ruby on Rails</a> and <a title="JRuby" href="http://www.jruby.org">JRuby</a> for my new blogging tool. As underlying database I have decided to go with the Rails default: <a title="SQLite" href="http://www.sqlite.org">SQLite</a>. SQLite has the advantage that it is an embeddable database, so you don&#8217;t need a separate database server to use it (which is very convenient when developing software). Note that when you are using JRuby you can also use <a title="Apache Derby" href="http://db.apache.org/derby/">Apache Derby</a> (which is an embeddable database written in Java) instead of SQLite if you want to.<span id="more-132"></span></p>
<p>When you use the standard version of Ruby getting SQLite support is easy, you just install the sqlite3-ruby gem (gem install sqlite3-ruby) and you&#8217;re done (you need to have the SQLite libraries and dev headers installed on your system already of course). This does not work for JRuby because the sqlite3-ruby is a native gem (containing C code with extensions on standard Ruby).</p>
<p>So how do you get SQLite to work with JRuby and Rails? Get the gems for JRuby! Assuming that you have SQLite installed on your system, you simply need to install the activerecord-jdbcsqlite3-adapter gem (this will automatically try to install the activerecord-jdbc-adapter and jdbc-sqlite3 gems if you don&#8217;t already have them). In your Rails project edit config/database.yml and change the adapter type to jdbcsqlite3 and you&#8217;re done <img src='http://www.without-brains.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>There are a number of activerecord-jdbc gems available (just type &#8220;gem search &#8211;remote activerecord-jdbc&#8221; in your shell to see them), including connectors for Apache Derby, <a title="MySQL" href="http://www.mysql.com">MySQL</a> and <a title="PostgreSQL" href="http://www.postgresql.org">PostgreSQL</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.without-brains.net/archives/132/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
