Re: multiple database users

[prev] [thread] [next] [Date index for 2005/06/03]

From: Andreas Fromm
Subject: Re: multiple database users
Date: 07:13 on 03 Jun 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You can find a paragraf abaut this in the docs of CDBI. The usual way to
do this, is to give your own db_Main - method which chosses between the
diferent connections you define.

Hartmaier Alexander wrote:
| Hi list!
|
| I just found out that one of my scripts is using the wrong db user to
| access my database.
|
| I created different users with different access rights in oracle I used
| before CDBI.
|
| The connection info is stored in the base class so a different user
| means a different db connection regardless which parameter is different.
|
| This topic was already on the list but for different databases but I
| think it?s the same problem
|
| I searched the list and also the wiki but didn?t find a solution...is
| there already a solution I missed?
|
| I was thinking of setting a module variable for the different db
| connections e.g.:
|
|
|
| **snip**
|
| package NAC::DBI;
|
|
|
| use strict;
|
| use warnings;
|
|
|
| use base 'Class::DBI::Oracle';
|
| use Class::DBI::Plugin::RetrieveAll;
|
| use Carp ();
|
| use dbtools;
|
| use nactools;
|
|
|
| dbtools::set_ora_env();
|
|
|
| if ($NAC::DBI::dbconnection eq ?1?)
|
| {
|
|   __PACKAGE__->connection('dbi:' . $dbtools::dbtype . ':' .
| $dbtools::database, ?username1?, ?password1?, {AutoCommit=>1});
|
| }
|
| # default connection
|
| else
|
| {
|
|   __PACKAGE__->connection('dbi:' . $dbtools::dbtype . ':' .
| $dbtools::database, ?username?, ?password?, {AutoCommit=>1});
|
| }
|
| **snip**
|
|
|
|   Can I set such a variable when loading my module with ?use mymodule;??
|
|
|
| -Alex
|
|
|
|
|

- --
Grüsse,

Andreas Fromm

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCoAMcUmBtSMq5cGURAh9wAJ9HSE2n32irwQXrDftxTKYhxQsKVQCgkOfS
PLGe6xqRznXMnfNJSQOaUuI=
=bBIc
-----END PGP SIGNATURE-----

multiple database users
Hartmaier Alexander 17:43 on 02 Jun 2005

Re: multiple database users
Andreas Fromm 07:13 on 03 Jun 2005

Re: multiple database users
William Ross 08:42 on 03 Jun 2005

Re: multiple database users
Hartmaier Alexander 10:29 on 06 Jun 2005

Re: multiple database users
Mark Addison 11:20 on 06 Jun 2005

Re: multiple database users
William Ross 11:39 on 06 Jun 2005

Re: multiple database users
Tony Bowden 13:09 on 06 Jun 2005

Re: multiple database users
Mark Addison 13:34 on 06 Jun 2005

Re: multiple database users
Perrin Harkins 14:30 on 06 Jun 2005

Re: multiple database users
Hartmaier Alexander 11:31 on 06 Jun 2005

Re: multiple database users
Hartmaier Alexander 11:51 on 06 Jun 2005

Re: multiple database users
William Ross 13:46 on 06 Jun 2005

Re: multiple database users
Hartmaier Alexander 14:03 on 06 Jun 2005

Re: multiple database users
William Ross 15:30 on 06 Jun 2005

Re: multiple database users
Hartmaier Alexander 16:44 on 06 Jun 2005

Re: multiple database users
William Ross 18:26 on 06 Jun 2005

Re: multiple database users
Jay Strauss 02:53 on 07 Jun 2005

Re: multiple database users
Perrin Harkins 03:58 on 07 Jun 2005

Re: multiple database users
William Ross 10:23 on 07 Jun 2005

Re: multiple database users
Hartmaier Alexander 09:28 on 07 Jun 2005

Re: multiple database users
Perrin Harkins 12:49 on 07 Jun 2005

Re: multiple database users
Hartmaier Alexander 12:49 on 07 Jun 2005

Re: multiple database users
Perrin Harkins 12:54 on 07 Jun 2005

Re: multiple database users
Hartmaier Alexander 13:02 on 07 Jun 2005

Re: multiple database users
Mark Addison 13:47 on 07 Jun 2005

Generated at 16:35 on 28 Jul 2005 by mariachi v0.52