Hi everyone
I started from scratch again
1. I downloaded the latest jTDS Open Source driver for MS SQL Server from
http://jtds.sourceforge.net
2. From this unzipped download, I placed the jtds-1.3.1.jar file in the ifs directory '/java/jdbc'
3. I executed the command
ADDENVVAR ENVVAR(CLASSPATH) VALUE('/java/jdbc/jdts-1.3.1.jar')
4. I changed my program to the following - its trying to connect to a MS SQL server
prop = JDBC_Properties();
JDBC_setProp(prop: 'userName' : 'As400_login');
JDBC_setProp(prop: 'password' : 'alanshoreiscool');
JDBC_setProp(prop: 'databaseName' : 'DirectResponseAdmin');
conn = JDBC_ConnProp('net.sourceforge.jtds.jdbc.Driver'
:'jdbc:jtds:sqlserver://WBOHQECDB01:1433'
: prop );
Then I ran the program
Its failing
This is what is being displayed
The java.version property was detected as input. This property is used as output only and has no effect on JVM initialization.
Exception in thread "main" java.lang.NoClassDefFoundError: net.sourceforge.jtds.jdbc.Driver
Caused by: java.lang.ClassNotFoundException: net.sourceforge.jtds.jdbc.Driver
at java.net.URLClassLoader.findClass(URLClassLoader.java:499)
at java.lang.ClassLoader.loadClass(ClassLoader.java:651)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:617)
Anyone see what I am doing wrong?
Alan Shore
E-mail : ASHORE@xxxxxxxx
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
'If you're going through hell, keep going.'
Winston Churchill
From: Alan Shore
Sent: Wednesday, September 13, 2017 10:58 AM
To: 'midrange-l@xxxxxxxxxxxx' <midrange-l@xxxxxxxxxxxx>
Subject: Accesssing External Databases
Hi everyone
Before I forget, we are on V7r1
I have been asked to investigate how we can connect to an external database
Google search presented the following web page
http://www.scottklement.com/jdbc/
Scott Klements - Accessing External Databases from RPG
Thank God for Scott
I am following his pdf presentation and I am somewhat sure that everything is loaded into our test system
Using one of his examples to access an SQL server database
I changed the connection string and the username and password and ran the example program in debug mode
It is failing
With
Exception in thread "main" java.lang.NoClassDefFoundError: com.microsoft.sqlserver.jdbc.SQLServerDriver
Caused by: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
at java.net.URLClassLoader.findClass(URLClassLoader.java:499)
at java.lang.ClassLoader.loadClass(ClassLoader.java:651)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
As this is ALL brand new to me - where do I even START to look at what my problem is?
As always - any and all help REALLY appreciated
Alan Shore
E-mail : ASHORE@xxxxxxxx<mailto:ASHORE@xxxxxxxx>
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
'If you're going through hell, keep going.'
Winston Churchill
As an Amazon Associate we earn from qualifying purchases.