title: Using embedded Derby with JRuby on Rails
body: <p>Attempting to use JRuby 1.2.0 and Rails 2.3.2 with an embedded Derby database.  I've copied <code>derbytools.jar</code> and <code>derby.jar</code> to <code>$RUBY_HOME/lib</code>, yet <code>rake db:migrate</code> still gives:</p>
  
  <pre><code>The driver encountered an error: 
      cannot load Java class org.apache.derby.jdbc.ClientDriver
  </code></pre>
  
  <p>Aaaand... I played a hunch and figured it out.  So, I'll post this here in case somebody else runs into the same problem I did.</p>
  
  <p>Almost all the documentation I found online has the following <code>database.yml</code> configuration for Derby:</p>
  
  <pre><code>development:
      adapter: jdbc
      driver: org.apache.derby.jdbc.ClientDriver
      url: jdbc:derby:[db];create=true
      username: xxx
      password: xxx
  </code></pre>
  
  <p>This probably works fine for a client/server setup, but for an embedded Derby setup, you need this:</p>
  
  <pre><code>development:
      adapter: jdbc
      driver: org.apache.derby.jdbc.EmbeddedDriver
      url: jdbc:derby:[db];create=true
      username: xxx
      password: xxx
  </code></pre>
  
  <p>Note the 'EmbeddedDriver', and not 'ClientDriver'.</p>