node-jdbc icon indicating copy to clipboard operation
node-jdbc copied to clipboard

Could not find class com.ibm.as400.access.AS400JDBCDriver

Open devavanza opened this issue 3 years ago • 1 comments

When initializing the JDBC constructor for db2 instance i got this error. please help me in this error i got stuck for a while

jdbc_error

devavanza avatar Sep 16 '21 12:09 devavanza

I don't know if you still need an answer to this issue but i think i know how to fix your error.

a picture of the error would be easier but i assume you do not have the driver installed for ibm AS400. Simply download the jt400.jar Here is the file you are looking for. Once this is downloaded, open it and copy the file named jt400.jar in the lib folder to a folder on your project called drivers

Then add this to your code:

var jinst = require("jdbc/lib/jinst");

if (!jinst.isJvmCreated()) {
  jinst.addOption("-Xrs");

  jinst.setupClasspath(["./drivers/jt400.jar"]);
}

This should fix your issue.

tonioss22 avatar Dec 30 '21 13:12 tonioss22