Pranoti
Pranoti

Reputation: 11

How can I use HSQLDB with Ruby on Rails.

I want a use new databse with Rubey on rails.

That database is HSQLDB.

How can I use?

Upvotes: 0

Views: 820

Answers (2)

tamersalama
tamersalama

Reputation: 4143

If you're on JRuby:

1- Download the hsqldb driver from here and add the hsqldb.jar to your /lib

2- In your project's config/database.yml file:

...
development:
  database: db_name
  adapter: jdbc
  driver: org.hsqldb.jdbc.JDBCDriver
  schema: K12_EDUCATION
  url: jdbc:hsqldb:file:./db_files/db_name

Upvotes: 0

Wodin
Wodin

Reputation: 3538

The easiest way is probably to use JRuby, since HSQLDB is a Java Database.

Otherwise, try http://www.infoq.com/news/ruby-driver-hsqldb and http://rubyforge.org/projects/hypersonic/

You might also want to have a look at SQLite instead of HSQLDB, since they are similar, but SQLite is not written in Java.

From http://www.sqlite.org/whentouse.html

With the default page size of 1024 bytes, an SQLite database is limited in size to 2 terabytes (2^41 bytes). And even if it could handle larger databases, SQLite stores the entire database in a single disk file and many filesystems limit the maximum size of files to something less than this. So if you are contemplating databases of this magnitude, you would do well to consider using a client/server database engine that spreads its content across multiple disk files, and perhaps across multiple volumes.

Read the rest of that page to see if it will suite your needs.

Two other pages you might find useful:
http://www.sqlite.org/faq.html
http://www.sqlite.org/mostdeployed.html

Upvotes: 2

Related Questions