node-jdbc
node-jdbc copied to clipboard
Could not find class com.ibm.as400.access.AS400JDBCDriver
When initializing the JDBC constructor for db2 instance i got this error. please help me in this error i got stuck for a while
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.