Dear Alexander,
Instead of setting CLASSPATH variable, please try in a terminal window:
c:\> set ODMS_JAVA_ARGS=-classpath /path/to/your/driver.jar
c:\> oplrun yourmodel.mod yourmodel.dat
(using oplrun on the terminal can display more useful error messages if needed)
Best regards,
------------------------------
Viu Long Kong
------------------------------
Original Message:
Sent: Thu May 13, 2021 07:05 AM
From: Alexander Diaz
Subject: CPLEX Optimization 20.1 - IBM ILOG Concert: No suitable driver found for jdbc:sqlserver
Hello.
I am working with OPL 20.1 on a Windows 10 a 64 bits laptop. I am trying to connect a SQL Server 2014 database, using a JDBC driver (mssql-jdbc-9.2.1.jre8.jar).
I am reading the database into IBM ILOG CPLEX Optimization Studio using statements in a .dat file, the code is shown below:
JDBCConnection conn("jdbc:sqlserver://ServerName:Port;databaseName=DatabaseName;integratedSecurity=true;trustedconnectio=true","");
I download the JDBC driver and I set it as an environment user variable CLASSPATH 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:
Excepción de IBM ILOG Concert: No suitable driver found for jdbc:sqlserver://ServerName:Port;databaseName=DatabaseName;integratedSecurity=true;trustedconnectio=true. Prueba201.dat /Prueba201 12:125-126 D:\ILOG\OPL\Prueba201\Prueba201\Prueba201.dat Marcador de problema de OPL
What could I be doing wrong? How do I set the driver to use?
Thank you.
Best regard.
------------------------------
Alexander Diaz
------------------------------
#DecisionOptimization