Re: Remote DB2 connectivity in Perl
- From: db2perl@xxxxxxxxxx (Db2perl)
- Date: Fri, 25 Aug 2006 09:24:51 -0500
As the doc from http://search.cpan.org/~ibmtordb2/DBD-DB2-0.80/DB2.pod
states, you can create a connection without a DSN quite easily. Here is a
small example:
#!/usr/bin/perl
use strict;
use DBI;
use DBD::DB2;
my $db = "mydb";
my $hostname = "myhostname";
my $port = 60000;
my $user = "dbuser";
my $pass = "dbpass";
my $string = "dbi:DB2:DATABASE=$db; HOSTNAME=$hostname; PORT=$port;
PROTOCOL=TCPIP; UID=$user; PWD=$pass;";
my $dbh = DBI->connect($string, $user, $pass) || die "Connection failed
with error: $DBI::errstr";
if ($dbh) {
print "Connected\n";
} else {
print "Not Connected\n";
}
"Dhirendra Jha" <dhirendraj@xxxxxxxxxx>
08/24/2006 11:39 PM
To
<dbi-users@xxxxxxxx>
cc
Subject
Remote DB2 connectivity in Perl
Hello Sir/Madam,
I am using the Active Perl for DB2 database automation. My DB2 database is
on Linux system. I want to connect the database from windows
machine(without
DSN) using perl. I have installed all the perl module such as DBI, DBD,
DB2,
Proxy, JDBC. Please provide me the information about this or it will be
better if you sned me small script for DB2 connectivity.
Regards,
Dhirendra Jha
- Follow-Ups:
- RE: Remote DB2 connectivity in Perl
- From: Dhirendra Jha
- RE: Remote DB2 connectivity in Perl
- References:
- Remote DB2 connectivity in Perl
- From: Dhirendra Jha
- Remote DB2 connectivity in Perl
- Prev by Date: Re: Rows returned are out of sync with the request.
- Next by Date: Re: Rows returned are out of sync with the request.
- Previous by thread: Remote DB2 connectivity in Perl
- Next by thread: RE: Remote DB2 connectivity in Perl
- Index(es):
Relevant Pages
|