Hello Peter,
I am currently working with OPL 20.1 on a windows 64 laptop. The database I am trying to connect to is a
sqlite 3.33.0 local database, using a
sqlite 3.27.2 JDBC driver.
The method I am using to read the database into OPL is using statements in a .dat file, the code is shown below:
JDBCConnection conn("jdbc:sqlite:product_data.db",
"DROP TABLE IF EXISTS results; CREATE TABLE results (Product VARCHAR, Inside INTEGER, Outside INTEGER)");
Products from JDBCRead(conn, "SELECT name, demand, insideCost, outsideCost, consumptionFlour, consumptionEggs FROM products");
Results to JDBCPublish(conn, "INSERT INTO results VALUES(?, ?, ?)");
In addition to this, the JDBC driver is downloaded and set as an environment variable
ODMS_JAVA_ARGS to make it available to the JVM used by OPL.
The problem is that when trying to execute the previously shown code, I get the following error:
No suitable driver found for jdbc:sqlite:product_data.db.I have also tried with a database locally hosted with MySQL 8.0.22 and the respective driver with the same results.
Thanks,
------------------------------
Juan David Zambrano
------------------------------
Original Message:
Sent: Wed December 23, 2020 10:20 AM
From: Petr Vilím
Subject: No suitable driver found for jdbc:sqlite
Hello,
I'm afraid that the question is too generic. Could you give us more details? What operation system are you using? What version of the database etc? Could you copy what exactly you're doing and what response you get?
Thanks, Petr
------------------------------
Petr Vilím
IBM
Original Message:
Sent: Fri December 18, 2020 08:36 AM
From: Juan David Zambrano
Subject: No suitable driver found for jdbc:sqlite
I am trying to use the new OPL 20.1 framework that allows OPL to read data from databases using statements in a .dat file. Nonetheless, when I follow the guides and set an environment variable ODMS_JAVA_ARGS, and try to run my code I get the following error:
"No suitable driver found for jdbc:sqlite"
What could I be doing wrong?
I am following this guide: IBM Data Science Community - IBM Data Science Community
Ibm | remove preview |
| IBM Data Science Community - IBM Data Science Community | The site home page | View this on Ibm > |
|
|
------------------------------
Juan David Zambrano
------------------------------
#DecisionOptimization