Read Database Metadata

Hi All,

I’m reviewing Ruby if its appropriate for my project. I’m planning to
port my existing application made from Java to Ruby but before I do that
I have to check if Ruby have capablities of doing the following:

  1. Connect to different Database.
  2. Read Database Metadata.
  3. JDBC like way of communicating with databases.

I would really appreciate if you can name some APIs and documents that
may enlighten me with my queries.

Thanks in advance,
Jag

Xd Ork wrote:

I’m reviewing Ruby if its appropriate for my project. I’m planning to
port my existing application made from Java to Ruby but before I do that
I have to check if Ruby have capablities of doing the following:

  1. Connect to different Database.
  2. Read Database Metadata.
  3. JDBC like way of communicating with databases.

You can certainly connect to different databases and read metadata. I
have no idea what a “JDBC like way” of communicating with databases
means.

I would really appreciate if you can name some APIs and documents that
may enlighten me with my queries.

http://ar.rubyonrails.com/ [used by Rails]
http://sequel.rubyforge.org/
http://datamapper.org
http://www.nitroproject.org/ [look for og]

Plus you have the lower-level ruby-dbi, and then the low-level APIs for
the native databases (e.g. ruby-oci8 for Oracle)

On Nov 27, 2008, at 6:44 AM, Xd Ork wrote:

If you want do have a behaviour that matches JDBC, use JRuby and
JDBC ;).

But to make things clear: Ruby as well as Java has no idea what a
database is.
So it is not a “Ruby capability”. But there are enough well-tested
libraries for
doing this in a lot of fashions that you can imagine. Databases are no
problem.

Regards,
Florian G.

Florian G. wrote:

On Nov 27, 2008, at 6:44 AM, Xd Ork wrote:

If you want do have a behaviour that matches JDBC, use JRuby and
JDBC ;).

But to make things clear: Ruby as well as Java has no idea what a
database is.
So it is not a “Ruby capability”. But there are enough well-tested
libraries for
doing this in a lot of fashions that you can imagine. Databases are no
problem.

Regards,
Florian G.

Thanks Florian for the reply.
I already tried JRuby and JDBC but I was thinking that since JDBC is
really for java, my code will then be only run in JRuby, making my
application requires their runtime which for me is not ideal and there’s
is no point anymore of migrating my old java application to ruby. I’m
looking for a library which works like JDBC. I googled around and found
Ramen but it only works now for few database. Can you name some library?

Brian C. wrote:

Xd Ork wrote:

I’m reviewing Ruby if its appropriate for my project. I’m planning to
port my existing application made from Java to Ruby but before I do that
I have to check if Ruby have capablities of doing the following:

  1. Connect to different Database.
  2. Read Database Metadata.
  3. JDBC like way of communicating with databases.

You can certainly connect to different databases and read metadata. I
have no idea what a “JDBC like way” of communicating with databases
means.

I would really appreciate if you can name some APIs and documents that
may enlighten me with my queries.

http://ar.rubyonrails.com/ [used by Rails]
http://sequel.rubyforge.org/
http://datamapper.org
http://www.nitroproject.org/ [look for og]

Plus you have the lower-level ruby-dbi, and then the low-level APIs for
the native databases (e.g. ruby-oci8 for Oracle)

Hi,

In JDBC, to connect into a database you just need to have a driver for
the database you want to connect to. Once connected you can get the
metadata of the database and query its properties. Same code and logic
will work in any database. These are the kinds of freatures I’m looking
if there is an equivalent in Ruby.

Thanks
Jag