× 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 Chris,

[SNIP]
After setting the classpath, I run the program from the command line
(call prog1).

It still is giving me the exact same error.
[SNIP]

I don't see anything wrong with your RPG code (at least, nothing that would lead to the error you're experiencing.) You specify "com.microsoft.sqlserver.jdbc.SqlServerDriver" as the driver name -- which is the correct name. (But I already knew that from the error message you posted.)

You need to figure out why!

A JAR file is really just a ZIP file that contains directories and Java executables. Inside this particular JAR file should be a directory named "com" that contains a subdirectory named "microsoft", that contains a subdirectory named "sqlserver", which contains "jdbc". Inside that "jdbc" directory there should be a file called SqlServerDriver.class.

Please verify that this is the case as follows:

a) Type STRQSH to get into QShell

b) Type: cd /my/dir
to get to the directory where you placed the sqljdbc.jar file.

c) Type: jar xvf sqljdbc.jar
This will "unzip" the JAR file, extracting all of the
files from it.

d) Type: cd com/microsoft/sqlserver/jdbc
To switch to the correct directory from the files you just
extracted.

e) Type: ls -l SQLServerDriver.class
This will show you the SQLServerDriver.class file.

f) Type: javap -classpath SQLServerDriver.class -public SQLServerDriver

This tells Java to print information about the SQLServerDriver class
that's compiled into the SQLServerDriver.class disk object. It'll
give you lots of information, but the key bit that I'm looking for
is the text that says:

public final class com.microsoft.sqlserver.jdbc.SQLServerDriver
extends java.lang.Object implements java.sql.Driver{

This tells you that this classname (which is the same one from your
RPG code) implements java.sql.Driver -- meaning that it's truly
a JDBC driver that you can use.

Anyway, if all of these steps work successfully... then you must still be doing something wrong with your CLASSPATH setting. If these steps
do not work successfully, please tell me what happens, and maybe I'll
be able to offer additional advice.

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.