DB Connections with hardcoded database.yml username? How do


I’m a bit (OK…a lot) confused about the way Rails establishes a DB
connection with the login/passwd that is hardcoded in database.yml,
even in production mode.

I’m using Rails to develop internal, inward-facing apps for my
company, rather than an external, outward-facing public
web site.

Once an end-user of my app authenticates w/ his login and passwd, I
want him to connect to the database with his login, rather than some
generic database.yml login that everyone uses. Different users have
different DB privileges, and diagnosing back-end DB issues is easier
when I am seeing unique logins rather than a generic one. (I’m a

I can certainly understand that, for a public web site, with
potentially hundreds or thousands of users, you don’t want each user
to have an official OS-level login that they can connect to the DB
with. But in my case, each of my several dozen users already has an
OS-level login. I use DB2, and its logins are based on those in the

Am I missing something here? Can Rails be influenced to conect to the
DB in this way?

Any help appreciated.