Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
3 replies Latest Post - ‏2013-02-04T19:06:19Z by SystemAdmin
SystemAdmin
SystemAdmin
3105 Posts
ACCEPTED ANSWER

Pinned topic DB2 LUW Client to DB2 Connect to DB2 for z/OS and the db2dsdriver.cfg

‏2013-01-04T14:36:39Z |
We are looking into having a .NET application (C#) running the DB2 LUW 9.7.5 client software that connects to a DB2 Connect Server (9.7.5 as well) which then connects to a DB2 for z/OS subsystem (DB2 10 for z/OS). For these connections we plan on using DB2 Trusted Contexts and DB2 Roles for security.

When I create the DB2Connection by specifying the TrustedContextSystemUserID and TrustedContextSystemPassword attributes in the DB2ConnectionStringBuilder in the code, everything looks fine. However, we’d rather these attributes not be hardcoded in an application so I’ve coded them in the db2dsdriver.cfg file:

***********************************************************************************
<configuration>
<parameters>
<parameter name="TrustedContextSystemUserID" value="masterid"/>
<parameter name="TrustedContextSystemPassword" value="masterpw"/>
</parameters>
</configuration>
***********************************************************************************

When I remove the code to specify them in the source, I get an “Object reference not set to an instance of an object” error. The db2diag.log file for the error has:

***********************************************************************************
2013-01-04-07.51.23.991000-300 I1H949 LEVEL: Event
PID : 696 TID : 5572 PROC : HbTbUse02.exe
INSTANCE: DB2 NODE : 000
EDUID : 5572
FUNCTION: DB2 UDB, RAS/PD component, pdLogInternal, probe:120
START : New Diagnostic Log file
DATA #1 : Build Level, 128 bytes
Instance "DB2" uses "32" bits and DB2 code release "SQL09075"
with level identifier "08060107".
Informational tokens are "DB2 v9.7.500.702", "s111017", "IP23286", Fix Pack "5".
DATA #2 : System Info, 1564 bytes
System: WIN32_NT GP93090 Service Pack 3 5.1 x86 Family 6, model 23, stepping 6
CPU: total:2 online:2 Cores per socket:2 Threading degree per core:1
Physical Memory(MB): total:1978 free:1000 available:1000
Virtual Memory(MB): total:4754 free:3448
Swap Memory(MB): total:2776 free:2448
Information in this record is only valid at the time when this file was
created (see this record's time stamp)

2013-01-04-07.51.23.991000-300 I953H552 LEVEL: Info
PID : 696 TID : 5572 PROC : HbTbUse02.exe
INSTANCE: DB2 NODE : 000
EDUID : 5572
FUNCTION: DB2 UDB, Remote Client Config API, rccConfig::getInstance, probe:75
DATA #1 : String, 250 bytes
<configuration>
<parameters>
<parameter name="GlobalParam" value="Value"/>
<parameter name="TrustedContextSystemUserID" value="masterid"/>
<parameter name="TrustedContextSystemPassword" value="masterpw"/>
</parameters>
</configuration>

2013-01-04-07.51.24.225000-300 I1507H441 LEVEL: Info
PID : 696 TID : 5572 PROC : HbTbUse02.exe
INSTANCE: DB2 NODE : 000
EDUID : 5572
FUNCTION: DB2 Common, Cryptography, cryptContextRealInit, probe:100
DATA #1 : String, 20 bytes
ICC VERSION: 8.0.0.0
DATA #2 : String, 50 bytes
ICC INSTALL PATH: C:\PROGRA~1\IBM\SQLLIB\BIN\ICC\C
DATA #3 : String, 18 bytes
ICC FIPS MODE: YES

2013-01-04-07.51.24.241000-300 I1950H497 LEVEL: Error
PID : 696 TID : 5572 PROC : HbTbUse02.exe
INSTANCE: DB2 NODE : 000
EDUID : 5572
FUNCTION: DB2 Common, Cryptography, cryptDecryptFinal, probe:10
MESSAGE : ECF=0x900004AC=-1879046996=ECF_CRYPT_DECRYPT_LENGTH_NOT_MULTIPLE_OF_BLOCKSIZE
Decrypt input length not a multiple of blocksize
DATA #1 : Hex integer, 4 bytes
0x00000008
DATA #2 : Hex integer, 4 bytes
0x00000003
***********************************************************************************

I don’t see any error messages from the z/OS MSTR or DIST address spaces.
So, it appears that the db2dsdriver.cfg file is being used to some degree. But why is it not using the TrustedContext parameters?

Also, whether I specify some of the attributes (ClientUserID, ClientApplicationName, ClientWorkstationName) in the db2dsdriver.cfg or the application source, these values will be empty in the DB2 for z/OS accounting records. If i don't specify them in either place, they will have the "expected" values (e.g. DB2 QWHCEUWN - End User Workstation Name - will be my workstation name). I was hoping to be able to override some of these values for z/OS WLM (Workload Manager) purposes. Can these values be overridden?
Updated on 2013-02-04T19:06:19Z at 2013-02-04T19:06:19Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    3105 Posts
    ACCEPTED ANSWER

    Re: DB2 LUW Client to DB2 Connect to DB2 for z/OS and the db2dsdriver.cfg

    ‏2013-01-05T01:47:20Z  in response to SystemAdmin
    there should be an api to override those identifiers (I know java has one)
    You might need to call some cli routines (which are implemented in unmanaged code) but it should be possible
  • SystemAdmin
    SystemAdmin
    3105 Posts
    ACCEPTED ANSWER

    Re: DB2 LUW Client to DB2 Connect to DB2 for z/OS and the db2dsdriver.cfg

    ‏2013-02-04T19:04:50Z  in response to SystemAdmin
    FYI, I worked with IBM on this. I upgraded by RUNTIME CLIENT to DB2 v9.7.7 and everything seems to be working.
  • SystemAdmin
    SystemAdmin
    3105 Posts
    ACCEPTED ANSWER

    Re: DB2 LUW Client to DB2 Connect to DB2 for z/OS and the db2dsdriver.cfg

    ‏2013-02-04T19:06:19Z  in response to SystemAdmin
    IBM DB2 LUW v9.7 fixpack 7 corrected the problem.