Forum: JRuby Example JDBC database.yml files and other questions

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Joseph A. (Guest)
on 2009-01-31 18:18
(Received via mailing list)
Could anyone send me some example jdbc database.yml files for these
databases:derby
h2
hsqldb

I don't have any experience with them and there aren't already version
of
these in the rails source.  Also I'm having trouble finding the jdbc
adapter
for oracle, is it activerecord-oracle_enhanced-adapter?  If so why
doesn't
it follow the naming convention of all the others?  Finally it doesn't
look
like there is a jdbc adapter for DB2, is this just because it hasn't
ever
been written?  I'm putting together the patch to get all these adapter
supported as valid options when a Rails app is created.

Joe
Roger P. (Guest)
on 2009-02-01 00:21
Joseph A. wrote:
> Could anyone send me some example jdbc database.yml files for these

here's an example--a little convoluted.
-=r

common: &common
  adapter: mysql
  encoding: utf8
  host: localhost
  socket: <%= %w[/tmp/mysql.sock /var/lib/mysql/mysql.sock
/var/run/mysqld/mysqld.sock
/opt/local/var/run/mysql5/mysqld.sock].detect { |f| File.exists? f } %>
  database: substruct_<%= RAILS_ENV %>
  username: root
  password:

development:
  <<: *common

test:
  <<: *common

production:
  <<: *common

ar_jdbc:
  <<: *common
  adapter: jdbc
  driver: com.mysql.jdbc.Driver
  url: jdbc:mysql://localhost/petstore_production
  database: petstore_production
Nick S. (Guest)
on 2009-02-01 22:53
(Received via mailing list)
On Sat, Jan 31, 2009 at 10:13 AM, Joseph A. 
<removed_email_address@domain.invalid>
wrote:
> Could anyone send me some example jdbc database.yml files for these
> databases:
> derby
> h2
> hsqldb

I think these will be similar to sqlite3, since they're usually used
as embedded, in memory databases. I know they also have options to run
as standalone database servers, but I'm not as familiar with them
running in those modes. People who are would probably opt for the pure
jdbc adapter with class name and URL, so the default database.yml
settings should be optimized for newcomers.

development:
  adapter: jdbch2
  database: db/myapp.development

> I don't have any experience with them and there aren't already version of
> these in the rails source.  Also I'm having trouble finding the jdbc adapter
> for oracle, is it activerecord-oracle_enhanced-adapter?  If so why doesn't
> it follow the naming convention of all the others?  Finally it doesn't look
> like there is a jdbc adapter for DB2, is this just because it hasn't ever
> been written?  I'm putting together the patch to get all these adapter
> supported as valid options when a Rails app is created.

We don't have a jdbcoracle or similar adapter since the oracle driver
is not open source, and we can't distribute it. So it's just the same
as you would do for the native oracle adapter, except that you either
have to manually load the activerecord-jdbc-adapter code ahead of
time, or use the 'adapter:jdbc' approach.

/Nick
> Joe

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Juan P. Tarquino (Guest)
on 2009-02-02 22:24
(Received via mailing list)
I have a rails app that uses Derby and has the database file(s) under
the
development folder under the db folder under the rails root folder. To
make
it work I had to install the activerecord-jdbcderby-adapter gem and in
my
database.yml I have the following:

development:
    adapter: jdbcderby
    database: db/development


Best regards,
Juan
This topic is locked and can not be replied to.