cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
Graudet
Level I

Is it possible to connect to a IBM DB2 database without using ODBC?

Hello,

 

     We use an IBM DB2 database through an SSL connection. The OCBC connection to the DB works well, but is quite complex to setup for the majority of the users. If a software can use a "type 4 db2 connection", odbc is not required. Only a "connection string" is sent directly to the remote server. The parameters of this string are usually configured directly in the software. A connection configuration is created in the software with the proper parameters, which is really simple to document by IT and to execute by the users.

 

     I feel that JMP doesn't support a "type 4 connection" directly, but R and python do. And it's also possible to extract data in a JSL script, like the example below. Could we create a small python script that creates a database connection that would then be available to JSL or to the query builder?

 

// JSL Script to extract some IBM DB2 data

New SQL Query(
	Connection(
		"ODBC:DSN=DBPROD1;MODE=SHARE;PWD=%_PWD_%;SECURITY=SSL;SSLCLIENTKEYSTASH=C:\BRMDB2\ssl\truststore.sth;SSLCLIENTKEYSTOREDB=C:\BRMDB2\ssl\truststore.kdb;SSLSERVERCERTIFICATE=C:\BRMDB2\ssl\carootcert.der;UID=%_UID_%;"
	),
	QueryName( "Extract exemple" ),
	CustomSQL(
		"SELECT NAME
        	   ,EMPLOYEE_NB 
        	   ,DEPARTMENT
        	   ,SALARY 
        FROM 
           EMPLOYEE_TABLE
        WHERE 
           DEPARTMENT = 'MFG02'"
        )
) << Run

     Thanks for your help!

1 REPLY 1
jthi
Super User

Re: Is it possible to connect to a IBM DB2 database without using ODBC?

Based on this Data Connectors  you would have to utilize ODBC. Other option would be to utilize Python Integration to make the queries. Write a function which takes in for example the query and inside it runs Python script to perform the query and returns the result as data table.

-Jarmo