I am on windows7, node version: 6.9.2, npm version: 3.10.9
When trying to make a connection to iSeries DB through ibm_db, I get an error as followed,
When tried without PORT, it takes more than 1 min to throw an ‘selectForConnectTimeout’ error,
{ Error: [IBM][CLI Driver] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the er
ror was detected: "153.6.245.250". Communication function detecting the error: "selectForConnectTimeout". Protocol specific error code(s): "0", "*", "*". SQLSTATE=08001
at Error (native)
errors: [],
error: '[node-odbc] SQL_ERROR',
message: '[IBM][CLI Driver] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the
error was detected: "153.6.245.250". Communication function detecting the error: "selectForConnectTimeout". Protocol specific error code(s): "0", "*", "*". SQLSTATE=08001\r\n',
state: '08001' }
When tried with PORT value:
{ Error: [IBM][CLI Driver] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the er
ror was detected: "153.6.245.250". Communication function detecting the error: "recv". Protocol specific error code(s): "*", "*", "0". SQLSTATE=08001
at Error (native)
errors: [],
error: '[node-odbc] SQL_ERROR',
message: '[IBM][CLI Driver] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the
error was detected: "153.6.245.250". Communication function detecting the error: "recv". Protocol specific error code(s): "*", "*", "0". SQLSTATE=08001\r\n',
state: '08001' }
My connection settings:
ibmdb.open("DATABASE=DBNAME; HOSTNAME=153.6.245.xxxx; UID=******;PWD=*****;",
function (err,conn) {
if (err) return console.log(err);
conn.query('SELECT ARDTGI, FNAMGI, LNAMGI FROM tablename WHERE KYDTGI = 35159 and SEQGI = 1810190',
function (err, data) {
if (err) console.log(err);
else console.log(data);
conn.close(function () {
console.log('done');
});
});
});
Could you please help with this?
Thanks,
Durai
ibmdb.open("DATABASE=DBNAME; HOSTNAME=153.6.245.xxxx; UID=******;PWD=*****;Port=portnum;PROTOCOL=TCPIP",
{connectTimeout : 20}, function (err,conn) {
Here, connection timeout value used is 20 seconds. Thanks.
Seems you are able to connect to the database if client is local but not when client is on remote system. Can your DBA confirm that remote client is able to connect to the server? Any remote client JDBC/ODBC. Check your server is configured to accept remote connection or not i.e. SVCENAME should be set to the port number and DB2COMM should be set to TCPIP on server.
Thanks and Regards,
Bimal Jha
Hi Durai,
Seems your Windows system has some older version of GSKit installed and it is pointed by the system PATH environment variable. Add .../ibm_db/installer/clidriver/bin/icc at the start of PATH and LIB system environment variable.
Thanks and Regards,
Bimal Jha
Hi Durai,
I would still request to share output of below commands to proceed further:
db2level
db2cli validate
npm install ibm_db
You can also run the steps in installer/testODBCConnection.sh file and share the collected trace files to bima...@in.ibm.com. File testODBCConnection.sh is for non-windows platform so you need to use corresponding windows commands to collect the traces after updating connection string in this file.
Thanks and Regards,
Bimal Jha