RE: Remote DB2 connectivity in Perl



Hi,
It gives the following error message:-

DBI connect('DATABASE=hpcindb; HOSTNAME=172.30.0.180; PORT=56000;
PROTOCOL=TCPIP
; UID=hpcinst; PWD=hpcin007pwd;','hpcinst',...) failed: [IBM][CLI Driver]
CLI000
4W Invalid connection string attribute. SQLSTATE=01S00 at Noname1.pl line
13
Connection failed with error: [IBM][CLI Driver] CLI0004W Invalid connection
str
ing attribute. SQLSTATE=01S00 at Noname1.pl line 13.

Regards,
Dhirendra Jha

_____

From: Kellen F Bombardier [mailto:kfbombar@xxxxxxxxxx] On Behalf Of db2perl
Sent: Friday, August 25, 2006 7:55 PM
To: Dhirendra Jha
Cc: dbi-users@xxxxxxxx
Subject: Re: Remote DB2 connectivity in Perl



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






Relevant Pages

  • Re: Remote DB2 connectivity in Perl
    ... I am using the Active Perl for DB2 database automation. ... I have installed all the perl module such as DBI, DBD, ... better if you sned me small script for DB2 connectivity. ...
    (perl.dbi.users)
  • Re: advice for perl expert wanting to learn python
    ... > Perl port to CLR doesn't seem to be coming soon. ... > What's the easiest way of learning python knowing perl? ... how does Python deal with database connectivity? ... > Is there a single API for connecting to databases? ...
    (comp.lang.python)