develooper Front page | perl.dbi.users | Postings from August 2006

RE: Remote DB2 connectivity in Perl

Thread Previous
From:
Dhirendra Jha
Date:
August 25, 2006 08:18
Subject:
RE: Remote DB2 connectivity in Perl
Message ID:
HERALDJTANZwwPcMFlF0000045f@herald.cybage.com
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@us.ibm.com] On Behalf Of db2perl
Sent: Friday, August 25, 2006 7:55 PM
To: Dhirendra Jha
Cc: dbi-users@perl.org
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@cybage.com> 


08/24/2006 11:39 PM 


To
<dbi-users@perl.org> 

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





Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About