ibmdb / node-ibm_db

IBM DB2 and IBM Informix bindings for node
MIT License
188 stars 151 forks source link

DB2 licensing problem using downloaded cli driver #926

Closed orizzontiholding closed 1 year ago

orizzontiholding commented 1 year ago

Hello Team!

I've successfully installed the library using the npm i ibm_db command. On my windows 11 machine I've used the set IBM_DB_HOME="C:\Program Files (x86)\IBM\Client Access" command and the env variable seems to be added, if I check using the set command in the cmd prompt of windows, it will show the variable and it's value.

I've pointed it to the default system folder where the sysadmin have installed the ibm iAccess tools. I have a folder called client access but I'm unable to find any cli zipped folder for cli driver. In our company we use AS400 servers so we connect to db2 without problems, at the moment I've noticed that when i cd into the ibm_db folder to give the command npm i it will start the download of the cli driver from the ibm server, but this will cause an issue with licensing, we don't have at the moment a licence but we are able to use db2 on premise.

when I run the db2cli command in command line this is the result

===============================================================================
Client information for the current copy (copy name: IBMDBCL1):
===============================================================================

Client Package Type       : IBM Data Server Driver Package
Client Version (level/bit): DB2 v11.5.8000.317 (s2209201700/64-bit)
Client Platform           : NT 64BIT
Install/Instance Path     : C:\PROGRA~1\IBM\IBMDAT~1

Common App Data Path      : C:\ProgramData\IBM\DB2\IBMDBCL1
DB2DSDRIVER_CFG_PATH value: <not-set>
db2dsdriver.cfg Path      : <Common App Data Path>\cfg\db2dsdriver.cfg
DB2CLIINIPATH value       : <not-set>
db2cli.ini Path           : <Common App Data Path>\cfg\db2cli.ini
db2diag.log Path          : <Common App Data Path>\db2diag.log

===============================================================================
List of all IBM Data Server client packages on the current workstation:
===============================================================================

Copyname      Version Package Language Installed-Location
-------------------------------------------------------------------------------
IBMDBCL1[C,D] 11.5.8000 DSD     ALL_LANG C:\Program Files\IBM\IBM DATA SERVER DRIVER
-------------------------------------------------------------------------------
 DSD: IBM Data Server Driver Package
-------------------------------------------------------------------------------

===============================================================================
db2dsdriver.cfg schema validation for the entire file:
===============================================================================

Note: The validation utility could not find the configuration file
db2dsdriver.cfg. The file is searched at
"C:\ProgramData\IBM\DB2\IBMDBCL1\cfg\db2dsdriver.cfg".

===============================================================================
The validation is completed.
===============================================================================

Is there a way to use our driver for the connection to db2 and avoid licensing problem?

bimalkjha commented 1 year ago

@orizzontiholding ibm_db driver do not work with IBM iAccess. You must need db2connect license to use ibm_db with AS400 server. As you already have dsdriver installed, you need to set IBM_DB_HOME=C:\Program Files\IBM\IBM DATA SERVER DRIVER and then install ibm_db. Then copy db2connect client license file under C:\Program Files\IBM\IBM DATA SERVER DRIVER\license directory to connect to AS400. Thanks.

orizzontiholding commented 1 year ago

@orizzontiholding ibm_db driver do not work with IBM iAccess. You must need db2connect license to use ibm_db with AS400 server. As you already have dsdriver installed, you need to set IBM_DB_HOME=C:\Program Files\IBM\IBM DATA SERVER DRIVER and then install ibm_db. Then copy db2connect client license file under C:\Program Files\IBM\IBM DATA SERVER DRIVER\license directory to connect to AS400. Thanks.

@bimalkjha at the moment we don't have any client connect licence due to the fact that we use AS 400 and IBM iAccess. Is there any way to use the odbc driver instead of client connect?

bimalkjha commented 1 year ago

@orizzontiholding You can try https://www.npmjs.com/package/node-odbc which uses odbc driver. We do not own it and I can not assist if you have any question or need any help for node-odbc package. Thanks.

orizzontiholding commented 1 year ago

@bimalkjha already tried, but it will not working as expected on windows, the connection will be closed. I think will give a try to sequelize if it will work for ibm i system. Thank you for the support. I hope in future the support for ibm i will be added to this library.