Use of HSQL with Sequel or DataMapper?


#1

Does anyone have an example of using HSQL with the Sequel or DataMapper
gems?
I think I’m making progress with ActiveRecord, but I’m not sure it’s my
gem
of choice.

I’ve tried, but I’m not able to get Sequel to connect to HSQL. I keep
getting
java.sql.SQLException: No suitable driver found for
jdbc:hsqldb:mem:test
and I’m not sure how to get past this. Any snippet would be helpful.

Thanks,
Lee

View this message in context:
http://www.nabble.com/Use-of-HSQL-with-Sequel-or-DataMapper--tp21175806p21175806.html
Sent from the JRuby - User mailing list archive at Nabble.com.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#2

Hi Lee,

I don’t have an answer to your question specifically, but have you
looked at h2?

http://www.h2database.com/html/features.html#comparison

Among other improvements it supports a MySQL emulation mode.

-m

On Dec 26, 2008, at 11:46 AM, nabblee wrote:

jdbc:hsqldb:mem:test
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#3

This seems promising, Mark. Thanks for the lead.

Now, let me make sure I understand: You are proposing that I use
DataMapper
against H2 in MySQL compatibility mode. Would I be able to do that with
a
MySQL driver, or do I need an H2 driver? Would my JDBC connect string
be
for mysql or for h2? Is this even possible if I want to run an
embedded,
in-memory database within my application?

Thanks again,
Lee

Mark A. O’Neil wrote:

-m

I’ve tried, but I’m not able to get Sequel to connect to HSQL. I keep
Sent from the JRuby - User mailing list archive at Nabble.com.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


View this message in context:
http://www.nabble.com/Use-of-HSQL-with-Sequel-or-DataMapper--tp21175806p21178064.html
Sent from the JRuby - User mailing list archive at Nabble.com.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#4

Hi Lee,

TBH I am only dabbling in the jRuby space and am using h2 with
hibernate in a couple projects and am quite satisfied. IMO the biggest
gain with h2 is speed and transaction support. The mode support is
definitely gravy.

That said:

I think the way to do this in a jRuby project would be to use the h2
driver (org.h2.Driver) and in the connection URL specify the MySQL
mode (jdbc:h2:data/music;MODE=MySQL)

Yes, modes are supported in both server and embedded mode.

There are some differences in the MySQL support over a std MySQL DB,
notably (http://www.h2database.com/html/features.html):
MySQL Compatibility Mode

To use the MySQL mode, use the database URL jdbc:h2:~/test;MODE=MySQL
or the SQL statement SET MODE MySQL .

 * When inserting data, if a column is defined to be NOT NULL and

NULL is inserted, then a 0 (or empty string, or the current timestamp
for timestamp columns) value is used. Usually, this operation is not
allowed and an exception is thrown.
* When converting a floating point number to a integer, the
fractional digits should not be truncated, but the value should be
rounded.
* The identifiers should be returned in lower case.
* Creating indexes in the CREATE TABLE statement should be
supported.
* For aliased columns, ResultSetMetaData.getColumnName() and
getTableName() return the real column and table name.

I think the above are workable issues and feel issues will be
relatively quickly resolved as Thomas (the developer) has a very
reasonable release schedule.

cheers,
-m

discussion group: http://groups.google.com/group/h2-database/