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



Buck,
Thanks for the reply. The jar file is OK, I see the classes as you said I would, the java source was copied (drag/drop) and re-compiled on the iSeries. All good. It runs but gives the "no suitable driver found for" and lists the connection parameters (connection string)... the same string works from my PC. Evan calling it with the -cp parameter (java -cp /java/jdbc/sqljdbc4.jar:. ibmiToSqlServer6) produces the same results

-----Original Message-----
From: JAVA400-L [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Buck Calabro
Sent: Tuesday, September 02, 2014 1:15 PM
To: java400-l@xxxxxxxxxxxx
Subject: Re: iSeries to MSSQL - No suitable driver found for jdbc

On 9/2/2014 3:37 PM, Graves, Chuck wrote:
Scenario:
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.
--buck
--
This is the Java Programming on and around the IBM i (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l.




[Rodda Paint Company!]
Chuck Graves
Director of Information Systems
Rodda Paint Co.<http://www.roddapaint.com>
6107 N. Marine Drive
Portland, Oregon 97203
(503) 737-6042


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.