On 9/2/2014 3:37 PM, Graves, Chuck wrote:
AS/400 model 520, running v5r4m0 - current on PTF's

I am trying to connect to a Microsoft SQL server using jdbc. I am using the notes/video from Craig Pelke, entitled "How to use the Microsoft JDBC Driver on the IBMi"
It works on my PC, connecting and pulling data from a remote SQL server

Java Versions:
On my PC:
Java version "1.6.0_45"

On my iSeries:
java version "1.6.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0_11-b03)
Classic VM (build 1.6, build JDK-1.6, native threads, jitc_de)

iSeries Environment Variables:
Name . . . . . . . . . : JAVA_HOME
Value . . . . . . . . . : '/QIBM/ProdData/Java400/jdk6'
Name . . . . . . . . . : CLASSPATH
Value . . . . . . . . . : '/java/jdbc/sqljdbc4.jar:/java/jdbc'

I am using the same jar file that was on my PC (sqljdbc4.jar)
I've tried all types of iteration of JAVA_HOME and CLASSPATH to no avail. I have put the sqljdbc4.jar file "everywhere" on the iSeries.
Has anyone made jdbc work with v5R4?

Java will only find your jar file where the CLASSPATH points. Your
CLASSPATH says /java/jdbc, so put it there. It doesn't need to be
anywhere else on the i side. If the jar file is already there, maybe
the jar file is corrupted - how did it get there? Windows drag and drop
works, as will FTP - but only if you use the BINary option. To verify
that the jar file is OK, start a qshell session (QSH command)
jar -tf /java/jdbc/sqljdbc4.jar

You should see a bunch of files listed like
com/microsoft/sqlserver/jdbc/Util.class If you see that, your jar file
is OK.

This worked on the PC; how did you get the class file up to the i? I'd
copy the Java source and javac it there, but you should be able to drag
the class file over via Windows Explorer.

Hope this jogs something loose.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

This mailing list archive is Copyright 1997-2021 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.