[unixODBC-support] Problem Accessing DB2 database.

Alan Smith alan.smith at tip-top.co.uk
Fri Nov 5 11:51:17 GMT 2004

Hi All,

I'm trying to connect to an iSeries DB2 database using the Perl (5.8.2) DBI on a SuSE 8.2 machine with DBD::ODBC, unixODBC and iSeries ODBC driver.

I can connect and execute queries using isql and everything works OK.

If I try to make a connection in my perl script with the following line:

dbh$ = DBI->connect ('dbi:odbc:TestDB2','user','pwd')
or die;

I get a segmentation fault.

If I remove the user name and password thus:

dbh$ = DBI->connect ('dbi:odbc:TestDB2','','')
or die;

I get the following error:

[Fri Nov  5 09:40:56 2004] null: DBI connect('DB2TestDSN','',...) failed: [unixODBC][IBM][iSeries Access ODBC Driver]Communication link failure. comm rc=8015 - CWBSY1006 - User ID is invalid, Password length = 0, Prompt Mode = Never, System IP Address = xxx.xxx.xxx.xxx(SQL-28000)(DBD: db_login/SQLConnect err=-1) at ../DB2_test.pl line 39

So is isql using different libraries or what?

Please help!

Alan Smith


Perl configuration:

Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
    osname=linux, osvers=2.4.20, archname=i586-linux-thread-multi
    uname='linux d20 2.4.20 #1 smp thu oct 10 18:10:26 utc 2002 i686 unknown unknown gnulinux '
    config_args='-ds -e -Dprefix=/usr -Dusethreads -Di_db -Di_dbm -Di_ndbm -Di_gdbm -Duseshrplib=true'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O3 --pipe',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing'
    ccversion='', gccversion='3.3 20030226 (prerelease) (SuSE Linux)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =''
    libpth=/lib /usr/lib /usr/local/lib
    libs=-lnsl -ldl -lm -lpthread -lc -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lpthread -lc -lcrypt -lutil
    libc=, so=so, useshrplib=true, libperl=libperl.so
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5/5.8.0/i586-linux-thread-multi/CORE'
    cccdlflags='-fPIC', lddlflags='-shared'

Characteristics of this binary (from libperl): 
  Built under linux
  Compiled at Mar 13 2003 22:22:34
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20041105/42e3ad99/attachment.html>

More information about the unixODBC-support mailing list