Gregg:
Sorry about the confusion.
After further examination, from numerous conflicting sources, I found the consensus to be that COM should be capitalized. Additionally, I have found that the format of the 'url' string to be in great flux and variation. I have reasoned, that many offers are for different client-platforms. Which is why I think that the combination of: 1) the url, 2) the Class.forName and 3) javac ... -classpath and java -cp
are all suspect, which means, I haven't got solid evidence on the proper combination. Following are my tries and results:
Notes:
I am able to PING the IP address and it comes back ok.
I am able to use the DB2 UDB (PC-based) Configuration Assistant to successfully connect to and query the server database. Therefore, I know that a) the connection between my PC and the server (a z/OS platform) works and b) that the server Database system is there and is replying to my simple query. "SELECT CURRENT DATE FROM SYSIBM.SYSDUMMY1;" and it returns, as expected, the current date.
===============================================================
Setup:
javac -g d:\javajdbc\DisplayQueryResults.java -classpath d:\db2v813base\java\db2java.zip;d:\db2v813base\java\db2jcc.jar
java -cp d:\javajdbc;d:\db2v813base\java\db2java.zip;d:\db2v813base\java\db2jcc.jar DisplayQueryResults
================================================================
Secnario 1:
String url = "jdbc
b2://xx.xxx.xx.xxx:446/D71A";
Class.forName("COM.ibm.db2.jdbc.net.DB2Driver").newInstance();
Results:
COM.ibm.db2.jdbc.DB2Exception: [IBM] {JDBC Driver] CLI0616E Error opening socket. SQLSTATE=08S01
[trace omitted]
==================================================================
Secnario 2: (Changed case of COM to com)
String url = "jdbc
b2://xx.xxx.xx.xxx:446/D71A";
Class.forName("com.ibm.db2.jdbc.net.DB2Driver").newInstance();
Results:
java.lang.ClassNotFoundException: com.ibm.db2.jdbc.net.DB2Driver
[trace omitted]
====================================================================
Secnario 3: Changed format of url string. COM back to all caps.
String url = "jdbc
b2
71A";
Class.forName("COM.ibm.db2.jdbc.net.DB2Driver").newInstance();
Results:
java.sql.SQLException: No suitable driver
[trace omitted]
====================================================================
Secnario 4: Changed "net" to "app" in Class.forName. All other parms back to values in Scenario 1.
String url = "jdbc
b2://xx.xxx.xx.xx:446/D71A";
Class.forName("COM.ibm.db2.jdbc.app.DB2Driver").newInstance();
Results: (Same as Scenario 3)
java.sql.SQLException: No suitable driver
[trace omitted]
======================================================
This leads me to believe that there is something within the -classpath/-cp parameters that needs to be changed/added (probably changed). I'm more than glad to change it, however, what is it that I'm looking for to be included during the javac/java processes, then I can search for them in some .jar or .zip file, if i knew for sure.
Your continued kindness is very much appreciated.
Regards,
Gary Joehlin
COS