× 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.



My link was from an iseriesnetwork article

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Thursday, December 06, 2012 9:24 AM
To: RPG programming on the IBM i / System i
Subject: Re: accessing SQL db in RPG

Hi Kim,

This is the link that I have... not sure what your link is from?
http://www.iprodeveloper.com/Content/Content/63737/RpgAndJdbc.zip



On 12/6/2012 7:41 AM, Kim Massar wrote:
Thanks Scott, I wanted to see if I have the updated code and tried
this link,
http://systeminetwork.com/Content/Content/17940/RpgAndJdbc.zip. It
didn't display anything, has this link changed? Thank You

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Wednesday, December 05, 2012 5:38 PM
To: RPG programming on the IBM i / System i
Subject: Re: accessing SQL db in RPG

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

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.




Email Confidentiality Notice: The information contained in this transmission is confidential, proprietary or privileged and may be subject to protection under the law, including the Health Insurance Portability and Accountability Act (HIPAA). The message is intended for the sole use of the individual or entity to whom it is addressed. If you are not the intended recipient, you are hereby notified that any use, distribution, copying or printing of this message is strictly prohibited and may subject you to criminal or civil penalties. If you received this transmission in error, please contact the sender immediately by replying to this email and then delete the material from any computer.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.