GithubHelp home page GithubHelp logo

Comments (4)

bimalkjha avatar bimalkjha commented on July 23, 2024

@Elaldradrain The extended client information is saved on Db2 for z/OS in special registers. You can set client information for non-Java clients by setting the value of special registers CURRENT CLIENT_USERID and CURRENT CLIENT_WRKSTNNAME.
I think this documentation can provide you detailed info about it: https://www.ibm.com/docs/en/db2-for-zos/11?topic=registers-general-rules-special#db2z_rules4specialregisters__chgregvals

For non-Java clients, you can set special registers using two methods: 1) By setting corresponding connection level attribues (SQLSetConnectAttr) and 2) By setting special register values in db2dsdriver.cfg file.

Currently, ibm_db has support for few connection level attributes only, but you can set client info using db2dsdriver.cfg file.
To set CURRENT CLIENT_USERID and CURRENT CLIENT_WRKSTNNAME special register, you need to create a .../ibm_db/installer/clidriver/cfg/db2dsdriver.cfg file and specify special register as below:

<configuration>
	<databases>
		<database name="sample" host="hotelfvt02.torolab.ibm.com" port="21169">
			<specialregisters>  				
				<parameter name="CURRENT CLINET_USERID" value="B Jha"/>
				<parameter name="CURRENT CLINET_WRKSTNNAME" value="hotelfvt02"/>
			</specialregisters>
	 	</database>
		<database name="sample2" host="hotelfvt02.torolab.ibm.com" port="21169">
		</database>
	</databases>
</configuration>

I would also suggest to check "General Rules for Special Registers" here: https://www.ibm.com/docs/en/db2-for-zos/11?topic=registers-general-rules-special
and https://www.ibm.com/docs/en/db2/11.1?topic=applications-application-compatibility-db2-zos too. Thanks.

from node-ibm_db.

Elaldradrain avatar Elaldradrain commented on July 23, 2024

Thank you very much for this very detailed reply!

I'm still missing one feature which I hope you can clarify for me. I need to change the client user dynamically on runtime, but I can't find any api for it. With dotnet I could do the following

Dim sqlconn As D2Connection = new DB2Connection()
sqlconn = new DB2Connection(szconnect_X)
sqlconn.Open()
sqlconn.ClientUser = "foobar"

The SQLSetConnectAttr you mentioned doesn't seem to be exposed by the nodejs clidriver wrapper.

from node-ibm_db.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.