How to use H2 from PHP or Rails?

180 views
Skip to first unread message

george

unread,
Mar 28, 2010, 8:28:49 AM3/28/10
to H2 Database
Is it possible, and if it is, how to use H2 from PHP and from Rails
too.
I mean *without* Quercus for PHP or jRuby for Rails. (on Windows and
MacOSX for development, and Linux for production deployment).

Thanks,

George.

Brian

unread,
Mar 28, 2010, 5:46:41 PM3/28/10
to H2 Database
Hopefully there are better answers - but based on my understanding,
this could be done by using the PostgreSql H2 server and connecting
via a Rails or PHP module intended to connect to PostgreSql. (ODBC
seems to be the most mentioned). I know Thomas has started on a C
port of H2 - so in some time (~1year?) or sooner we could have a
native C version which would be easier to build native PHP/Ruby db
connection modules for.

george

unread,
Apr 4, 2010, 1:26:04 PM4/4/10
to H2 Database
Hi Brian,

thank you for your reply

> Hopefully there are better answers - but based on my understanding,
> this could be done by using  the PostgreSql H2 server and connecting
> via a Rails or PHP module intended to connect to PostgreSql.

> (ODBC seems to be the most mentioned).

This seems to work only on Windows :(.

> I know Thomas has started on a C
> port of H2 - so in some time (~1year?) or sooner we could have a
> native C version which would be easier to build native PHP/Ruby db
> connection modules for.

I saw those posts, but I'm not sure why it must be easier with C?
If the driver/server protocol is known, than one "driver" made in Ruby
or PHP
wouldn't be easier to implement instead of an entire database?

This could open H2 to many many new users, since having the fastest
database for free in a project
is something many users would like :).

many thanks,
George.

Wildam Martin

unread,
Apr 6, 2010, 5:11:18 AM4/6/10
to h2-da...@googlegroups.com
On Sun, Apr 4, 2010 at 19:26, george <george...@yahoo.com> wrote:
>> (ODBC seems to be the most mentioned).
> This seems to work only on Windows :(.

ODBC does not work out of the box on Linux - you need some additional
libraries - however, I was not able to find out how myself - but did
not invest too much time.

--
Martin Wildam

Ryan How

unread,
Apr 6, 2010, 8:52:36 AM4/6/10
to h2-da...@googlegroups.com
I know nothing about PHP or Rails, but how would you use a Postgres
database from them? Can't you just use the same thing for H2 and put it
in PG mode?
Reply all
Reply to author
Forward
0 new messages