[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] database connectivity....at last!



Well, something about this just doesn't seem to jive with what I've got
happening here.

I've got Sybase running on a Sun box.  Proxy server works dandy when I call
it from a Unix proxy client.  But when I move the client to the mac, it
hangs on connect.

Also, I needed to modify the RPC:: scripts to not call Storable, a Unix
module for persistence.  That might be part of my trouble, but the script
won't compile if I just use the Mac port of DBI 2.08, and the standard
distributions of RPC/PlRPC and Net/NetDeamon.

Any ideas most welcome.

Also, I still do run into the Sys/Syslog errors if the connection fails.

I'd post my script, but all I did was set the hostname, port num, etc. in
the script posted by Adam.

>Hello,
>
>Some instructions for getting DBI::ProxyServer and DBD::Proxy working on a
>mac, it turned out to be quite simple in the end...
>
>Linux machine:
>
>ASE v11.0.3.3 for Redhat Linux release 5.2 Kernel 2.0.36
>perl v 5.005_03
>DBI v1.08
>DBD::Sybase.pm (in this case, but i would imagine it will work with other
>drivers..?)
>
>start the ProxyServer using
>
>perl /usr/bin/dbiproxy -debug -localport=12000
>
>Mac machine:
>
>MacPerl v5.2.0r4
>DBI v1.08 ported for the mac by Chris Nandor
>RPC/PlRPC v0.2010 from CPAN
>Net/NetDaemon v0.20 from CPAN
>
>and the following script works for me....
>
>-------------------------------
>
>#! perl -w
>
>use strict;
>use DBI;
>
>my $dsn =
>'DBI:Proxy:hostname=<hostname>;port=12000;dsn=DBI:Sybase:server=SYBASE';
>
>my $dbh = DBI->connect($dsn, 'user', 'passwd') or die $DBI::errstr;
>
>my $sth = $dbh->prepare( 'select * from mytable' );
>
>$sth->execute;
>
>DBI::dump_results($sth);
>
>$sth->finish;
>
>$dbh->disconnect;
>
>---------------------------------
>
>
>one word of warning, i found on one occasion an error in my database server
>occured which meant i had to restart the server.... (basically a syntax
>error in the SQL statement prepared, caused by a typo) but i haven't been
>able to reproduce this, so just be careful when using this initially...? at
>the time i was using DBI v1.06 on the linux box, i have now upgraded to
>v1.08.. but i have no idea if this has fixed it, as i have not seen the
>error since.
>
>adam
>
>
>
>
>
>
>===== Want to unsubscribe from this list?
>===== Send mail with body "unsubscribe" to macperl-request@macperl.org




===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org