×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Hi Kim,
On 12/5/2012 1:53 PM, Kim Massar wrote:
I ran it this morning and it was ok, then I added the query part back
into the program and recompiled it. Now I am getting the
NoClassDefFoundError:.
This means it can't find a class definition. With JDBC, you typically
will have classes defined in a JAR file (which, under the covers, is
really just a glorified ZIP file containing compiled Java classes).
Java will read the CLASSPATH environment variable for the list of JAR
files (or other containers, such as directories) that might contain
class definitions.
You didn't say which Java class is missing -- but, as most of JDBC is
built-in to Java, I suspect it's the specific database driver that's
missing. Have you placed your JAR file into the CLASSPATH?
Also, MSSQLTEST is an old example that I do not like:
1) It attempts to set the CLASSPATH inside the RPG program that uses it.
IMHO, that's not a good idea. (I did not write the code in this
example, this was provided by someone else.)
2) It uses the sqljdbc.jar driver from Microsoft that in my opinion,
isn't a very good driver. I recommend using the jTDS one instead.
Could I be getting the error because it was defined from running this
morning and now I am trying to define it again? Thanks
Aside from the CLASSPATH stuff I mentioned, above... My only guess is
that something got messed up in the JVM. Signing off and back on again
will give you a fresh JVM, and will cause Java to re-load the CLASSPATH
as well. (So make sure it's set properly before starting any Java
programs in the fresh job.)
-SK
As an Amazon Associate we earn from qualifying purchases.