in reply to Can Apache::DBI do this???

Yes, there is a way to allow users to access a DBMS with custom permissions, but you'll have to be very careful about security. The steps might go like this:

Now, that won't get you the caching goodness of Apache::DBI, and you'll have to create a new db handle on each subsequent request. Myself, I'm just too lazy to read up on whether Apache::DBI is able to cache many different kinds of handles (different users/passwords); but I wouldn't be surprised if it did.

Update maybe it will: gratuitous document quoting =>

[when configured appropriately, Apache] looks if the environment variable GATEWAY_INTERFACE starts with 'CGI-Perl' and if the module Apache::DBI has been loaded. In this case every connect request will be forwarded to the Apache::DBI module. This looks if a database handle from a previous connect request is already stored and if this handle is still valid using the ping method. If these two conditions are fulfilled it just returns the database handle. The parameters defining the connection have to be exactly the same, including the connect attributes ! If there is no appropriate database handle or if the ping method fails, a new connection is established and the handle is stored for later re-use

so, apparently, yes. HTH

Replies are listed 'Best First'.
Re: Re: Can Apache::DBI do this???
by Anonymous Monk on May 08, 2001 at 00:57 UTC
    Wow, that was fast.... replies in 10 minutes! Thanks for the answers. They should give me some idea to start.