Comments (4)
@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.
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)
- Update Axios HOT 1
- Timeout is not working with connectionPool or non-pooled connection HOT 2
- byte change when inserting hex byte array into varchar(16) for bit data column HOT 2
- Error: /node_modules/ibm_db/build/Release/odbc_bindings.node: ELF file's phentsize not the expected size HOT 4
- Unable to connect using TLS. Error - SQL30081N, Protocol Specific Error -414 HOT 2
- DB2 connection pool is unavailable after DB2 server restart HOT 1
- PDF content error happens after inserted PDF BLOB to DB2 table HOT 6
- insert data error HOT 2
- Bug Report_Getting " PrintDeps.exe Bad image" pop-ups while running tests from terminal using ibm_db package with Playwright with JavaScript HOT 8
- string returned after date type requested HOT 1
- Fetch multiple rows HOT 2
- adm-zip can it be moved to dev dependencies HOT 2
- queryResult deferred callback result changed with version 3.2.3 HOT 5
- Node ibm_db Installation Error with Python 3.12 HOT 2
- conn.query callback being fired before all queries are finished. (possibly) HOT 1
- Release v3.2.4 HOT 1
- Bug Report - Could not locate the bindings file. HOT 2
- Having trouble get a valid npm install in a GitLab CI Pipeline HOT 2
- libcrypto.so.1 error HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-ibm_db.