CraZySacX / node-jdbc

JDBC Wrapper for node.js
140 stars 106 forks source link

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

Open devavanza opened 2 years ago

devavanza commented 2 years ago

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

tonioss22 commented 2 years ago

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.