For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > August 2005 > connect to a database when using a proxy (to access the internet)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author connect to a database when using a proxy (to access the internet)
ver_for@yahoo.it

2005-08-31, 6:57 pm

Hi,

To connect remotely to a database I was using this code:
my $dsn = " DBI:$driver:$database:name_of_the_databa
se";
my $dbh = DBI->connect($dsn,$user,$pass);
And It worked.

Now I use a proxy to access the internet. How can I however connect to
the remote database?

Thanks in advance,

Paul Lalli

2005-08-31, 6:57 pm

ver_for@yahoo.it wrote:
> Hi,
>
> To connect remotely to a database I was using this code:
> my $dsn = " DBI:$driver:$database:name_of_the_databa
se";
> my $dbh = DBI->connect($dsn,$user,$pass);
> And It worked.
>
> Now I use a proxy to access the internet. How can I however connect to
> the remote database?


Have you read the documentation for the module you're using?

perldoc DBI

Searching through that for the word 'proxy' reveals this snippet:
========================================
==========================
If the environment variable DBI_AUTOPROXY is defined (and the driver
$data_source is not "Proxy") then the connect request will
automatically be changed to:

$ENV{DBI_AUTOPROXY};dsn=$data_source

DBI_AUTOPROXY is typically set as "dbi:Proxy:hostname=...;port=...". If
$ENV{DBI_AUTOPROXY} doesn't begin with 'dbi:' then "dbi:Proxy:" will be
prepended to it first. See the DBD::Proxy documentation for more
details.
========================================
===========================

I suggest you follow the advice therein, and take a look at the
DBD::Proxy documentation.

Paul Lalli

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com