[unixODBC-support] Huge problems connecting to a DB2 database.

Nicklas Börjesson Nicklas.Borjesson at ws.se
Sat Sep 18 09:43:58 BST 2010


Ok, installing the entire IBM data client 9.7 package and use its files instead didn't work either.

//Nicklas


-----Original Message-----
From: unixodbc-support-bounces at mailman.unixodbc.org on behalf of Nicklas Börjesson
Sent: Sat 2010-09-18 10:08
To: Support for the unixODBC project
Subject: RE: [unixODBC-support] Huge problems connecting to a DB2 database.
 
Hi Dave,

I have tried that too, the same error occurs.
Also, an ldd of both libraries show that all dependencies are satisfied.
I am beginning to doubt if my db2 client libraries are correctly installed. 
I have used the fix packs for installation since they seemed to install all that was needed, I couldn't find any other client downloads except really costly ones. I might have to rethink that approach... 

//Nicklas

-----Original Message-----
From: unixodbc-support-bounces at mailman.unixodbc.org on behalf of David Ritter
Sent: Sat 2010-09-18 03:11
To: Support for the unixODBC project
Subject: Re: [unixODBC-support] Huge problems connecting to a DB2 database.
 
Hello Nicklas,

It looks like you are trying to use a 64-bit DB2 client (based on the library you are loading). I believe that you need to use the library libdb2o.so for 64-bit DB2 odbc connectivity.

http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.apdv.cli.doc/doc/t0006349.htm

Hth,
Dave

________________________________________
From: unixodbc-support-bounces at mailman.unixodbc.org [unixodbc-support-bounces at mailman.unixodbc.org] On Behalf Of Nicklas Börjesson [Nicklas.Borjesson at ws.se]
Sent: Friday, September 17, 2010 4:59 PM
To: unixodbc-support at mailman.unixodbc.org
Subject: [unixODBC-support] Huge problems connecting to a DB2 database.

Hi, desperate unixODBC-newbie here..

I have now been trying, for weeks, to connect to a DB2 server using unixodbc.
During this time I have successfully connected to other servers, like MSSQL and others.

But when connecting to DB2, with or wihout DSN, from iSQL or pyODBC, sudo or no sudo, I constantly get this error:
"[IM004] [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed (0) (SQLDriverConnectW)"

I have now tried EVERY trick I have found on the net.
I have tried using libdb2.so-versions for IBM Client 8.1,9.1 and 9.7, always getting the same error.
Output of:

$ odbcinst --v
unixODBC 2.3.0

$ odbcinst -q -d
[FreeTDS]
[DB2_97]

$ odbcinst -q -s
[ODBC]
[FS01DB2]


Currently the ini-files looks like this(confirmed through odbcinst -j:

odbcinst.ini:
******** Start ***************************

[FreeTDS]
Description = TDS driver (Sybase/MS SQL)
Driver = /usr/lib/odbc/libtdsodbc.so
Setup = /usr/lib/odbc/libtdsS.so
debug flags = 0xff
CPTimeout =
CPReuse =

[DB2_97]
Description     = DB2Driverfor9.7
Driver          = /opt/ibm/db2/V9.7/lib64/libdb2.so
FileUsage       = 1
DontDLClose     = 1
DMEnvAttr       = SQL_ATTR_UNIXODBC_ENVATTR= {DB2INSTANCE=db2inst1}
******* End ******************************

odbc.ini:
******** Start ***************************

[ODBC]
Trace        = Yes
TraceFile    = /tmp/sql.log
ForceTrace   = Yes
ODBC]

Trace           = Yes
TraceFile       = /tmp/odbc_tr

[FS01DB2]
instance = db2inst1
database = test
driver = DB2_97
server = mydb2server
port = 50000
username = username
password =pw

******** Start ***************************

I am running 64-bits Ubuntu(lucid) on an AMD-64 box.
I have also tried all conceivable attribute names. I think. :-)
I am bordering on losing it and any help would be greatly appreciated!

//NIcklas



_______________________________________________
unixODBC-support mailing list
unixODBC-support at mailman.unixodbc.org
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
_______________________________________________
unixODBC-support mailing list
unixODBC-support at mailman.unixodbc.org
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support




-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 4875 bytes
Desc: not available
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20100918/c11eebad/attachment.bin>


More information about the unixODBC-support mailing list