JMP 19 to connect to JDBC IBM DB2IBM DB2 migrating from ODBC to JDBC.
While ODBC connections have been working fine, we are unable to find a working solution for JDBC connection through JMP 19.
Classpath has been defined for JDBC driver.
But still gives error that it failed to load Driver.
Appreciate, if someone can share working solution.
// Ensure you have the IBM Db2 JDBC driver JAR (db2jcc4.jar) in JMP's Java classpath
// You can get it from IBM's Db2 installation or download from IBM Fix Central
// JDBC connection parameters for IBM Db2
dbDriver = "com.ibm.db2.jcc.DB2Driver";
dbURL = "jdbc:db2://db2.exampleURL.com:50001/isdw:sslConnection=true;sslVersion=TLSv1.2;"; // Replace with your host, port, and DB name
dbUser = "<EM>username</EM>"; // Replace with your Db2 username
dbPass = "<EM>mypassword</EM>"; // Replace with your Db2 password
// Load the JDBC driver
Try(
Java Open( dbDriver ),
Throw( "Failed to load JDBC driver: " || dbDriver )
);
// Open the database connection
conn = Open Database(
"Driver=JDBC:" || dbDriver || ";URL=" || dbURL || ";UID=" || dbUser || ";PWD=" || dbPass
);
// Check if connection succeeded
If( Is Empty( conn ),
Throw( "Database connection failed." )
);
// SQL query example
sqlQuery = "select lot_id,
<BR /><EM>............ example SQL query that has been working in ODBC................</EM>
order by lot_Id, wafer_Id, parm_Label, level
WITH UR
;
";
// Execute query and load into JMP data table
dt = Execute SQL( conn, sqlQuery );
// Close the connection
Close Database( conn );
// Show the data table if results exist
If( !Is Empty( dt ),
dt << Show Window,
Print( "No data returned from query." )
);


Data AccessRe: JMP 19 to connect to JDBC IBM DB2Your code looks LLM generated and they aren't generally that good with JSL. Have you tried to use JMPs Query Builder to make the query first time? After that you can easily get the script for that (New SQL Query())

Using JMP > Import Your Data > Build SQL Queries in Query Builder
Re: JMP 19 to connect to JDBC IBM DB21) JMP Query Builder is going directly into Open Data File dialog box.
2) Alternatively tried File --> Connect To --> Data Connections

However, it only shows existing ODBC connections or lets create new ODBC connections only. No JDBC connection option.
Re: JMP 19 to connect to JDBC IBM DB2Does JMP only support ODBC connections only and not JDBC?
Re: JMP 19 to connect to JDBC IBM DB2JMP does not support JDBC. It is possible to use Python connections to JDBC brokers for this purpose. Of course, you'll have to have Java installed on any machines you deploy to.
Regards,
Brian Corcoran
JMP Development