could someone please point me to good example on how to make a JDBC connection to an IBM DB2 database?
Here's how I did it:
Needs@"JLink`"; AddToClassPath["/opt/ibm/db2/V10.5/java/db2jcc4.jar"]; Needs@"DatabaseLink`"; driver = "com.ibm.db2.jcc.DB2Driver"; connStr = "jdbc:db2://localhost:50000/TEST"; username = "db2inst1"; password = "password"; conn = OpenSQLConnection[JDBC[driver, connStr], "Username" -> username, "Password" -> password];
This is with a more or less plain installation of DB2 Express-C on Lubuntu 14.04.
After installation and before evaluating the above WL, my command line prep was roughly this (
db2inst1 is the instance owner user account configured by the DB2 installation):
$ su db2inst1 $ cd $ sqllib/db2profile $ db2start $ db2 db2 => create database test