Don't forget to read about the DBI_AUTOPROXY env var in the DBI docs.
Tim.
On Thu, Apr 18, 2002 at 05:31:55PM -0400, David Dierauer wrote:
> I use DBD::Proxy from Mac OS X to connect to a Linux server that has
> Oracle client libs installed and is running dbiproxy.
>
> First of all, don't set $ENV{'ORACLE_HOME'} on the OS X machine; it needs
> to be set for the machine running dbiproxy.
>
> Next, here's what my proxy connection looks like:
>
> my $dsn =
>
>"DBI:Proxy:hostname=xxx.xxx.xxx.xxx;port=19000;dsn=dbi:Oracle:host=yyy.yyy.yyy.yyy;sid=SID";
> $dbh = DBI->connect($dsn, 'user', 'passwd');
>
> where xxx.xxx.xxx.xxx represents the IP address (or domain name) of the
> proxy server, and yyy.yyy.yyy.yyy
> represents the IP address of the machine that is the actual Oracle
> database server.
>
> Then I usually set such attributes as RaiseError once I've got the
> database handle, e.g. $dbh->{RaiseError} = 1;
>
> I hope this helps.
>
> --
> David Dierauer
> Database Programmer
> [EMAIL PROTECTED]
>
> On Wed, 17 Apr 2002, Chuck Tomasi wrote:
>
> > I'm currently using Perl 5.6.0 on a Sun with DBD::Oracle using the
> > following:
> >
> > sub DBConnect
> > {
> > my ($o_dbh);
> > my ($dsn);
> >
> > $ENV{'ORACLE_HOME'} = $defs::DB{Home};
> >
> > $o_dbh =
> > DBI->connect("DBI:Oracle:host=$defs::DB{host};sid=$defs::DB{sid}",
> > $defs::DB{userid}, $defs::DB{passwd},
> > { RaiseError => 1,
> > AutoCommit => 1,
> > LongTruncOk =>1,
> > LongReadLen => 65536,
> > PrintError => 0 });
> > &Error(DBI->errstr) if (! $o_dbh);
> > return ($o_dbh);
> > }
> >
> > Can someone assist me with translating this to DBD:Proxy? I see how to
> > condense the first argument from the perldoc information, but the
> > anonymous hash with things like RaiseError, AutoCommit, etc. are stumping
> > me. How do I pass those along when using DBD:Proxy?
> >
> > My goal is to be able to use my Perl application on a host that doesn't
> > have an Oracle client available (NetBSD in particular), but Mac OS X would
> > be nice too.
> >
> > --Chuck
>