On 4/13/06, Linda Ding <[EMAIL PROTECTED]> wrote:
> We have a requirement here that we can't hard code any oracle database
> instance name for security reasons. Is there any way we can pass the
> connection string (for example, the oracle tnsname alias), or put the
> instance name in a configuration file and somehow pass the information
> from the configuration to the DBI code,  so that the public won't see
> the actual instance name in the code???? I know we can do that in many
> other languages, but, can we do that using DBI for oracle???
>
>
> use strict;
> use DBI;
>
> my $dbh = DBI->connect( 'dbi:Oracle:orcl',
>                        'jeffrey',
>                        'jeffspassword',
>                      );

I think the OP's question is more simple than what is being answered. 
It looks like she doesn't realize she can use a variable instead of a
hard coded literal in the connect method.

Linda,

Your connect can look like:

my $dbh = DBI->connect( $connect_string, $userid, $password);

You are free to use whatever way you choose to populate the
$connect_string, $userid, and $password variables.  There are probably
about a million different ways to choose from.

Jay

Reply via email to