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



Can you ping SQL Server from the AS/400? Why are you using a ip address
rather than the SQL Server Name. Can you ping the SQL Server name from the
AS/400?


On Tue, Dec 18, 2012 at 6:11 PM, Graves, Chuck <cgraves@xxxxxxxxxxxxxx>wrote:

Scott,
Thank you so much for your help. You were correct. I'm not sure where I
found that, but I had copied it from somewhere on the internet

(??? lies on the internet??? OMG)

At any rate, I got past all my java errors, (by pointing the iSeries to
java version 1.6 via a SystemDefault.properties file in my /home/me
directory) but I still cannot connect. I'm failing here:

conn = CallConnectMethod(JNIENV_P: drv: mid: str: prop)

in the JDBCR4 *Srvpgm

The values going in are:

JNIENV_P = SPP:EEDB1E8B3E002000
Drv=12
Mid=8
Str=15
Prop=8

I have tried every conceivable combination of everything at this point,
including trying to connect to different versions of SQL servers, different
users, with & without properties, with & without domain names, with &
without the domain property value,
I can sign-on to the SQL server(s), I can access the database all with the
various ID's/passwords I've tried through SQL Server Management Console.
I've done "netstat -a" and verified that port 1433 is listening

I have NO DOUBT that it is something in my environment and not your code,
just don't know where to look

This is what I get everytime:

Java Virtual Machine is Classic.
JVM properties were loaded from a properties file.
Unable to connect.

So, before I hit my head on the table... again, I'll go try to get SSH
working to our new bank tomorrow and come back to this.

THANK YOU again...
Chuck




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

Hi Chuck,

That does not look like a proper URL for connecting to a SQL server
database. This is what you have, and it looks wrong to me:

java:jdbc:sqljdbc.jar:192.168.1.21:1433

For some reason, you've removed the "sqlserver" keyword, and replaced it
with the name of your JAR file. That doesn't make any sense, as the name
of your JAR file has nothing to do with connecting to a server.
The JAR file belongs in the CLASSPATH -- it does not belong in the URL!!

I'm expecting your URL to look like this:

jdbc:sqlserver://192.168.1.21:1433


Also you have an equal sign in your JDBC properties. This is also wrong
-- though, you aren't getting far enough in the process for these to cause
a problem for you, yet. But this is what you have:

prop = JDBC_Properties();
JDBC_setProp(prop: 'databaseName=': 'database name');
JDBC_setProp(prop: 'user=' : 'domain name\user');
JDBC_setProp(prop: 'password=' : 'password');

The equal signs are changing the names of the properties. They will cause
the process to fail. why did you add them? None of my examples do that!
They should look like this:

prop = JDBC_Properties();
JDBC_setProp(prop: 'databaseName': 'database name');
JDBC_setProp(prop: 'userName' : 'whatever the user is');
JDBC_setProp(prop: 'password' : 'password');

Also, as I said before (in the message you quoted back when you replied) I
do not recommend using the Microsoft JDBC driver. It does not work nicely.
Please consider using the jTDS one instead.

-SK



On 12/17/2012 4:57 PM, Graves, Chuck wrote:
I too am trying to access the SQL server using the MSSQLTEST routines.
After applying a full set of cumulative PTF's, downloading the JAVA
(5722JV1) options 10 & 11, then applying the Java Group PTF's, and
finding out how to get the iSeries to use a different version of the
JVM, I have finally gotten past all the "Invalid ClassDefinition"
errors etc. and the program runs, however all I get is the "Unable to
Connect." Error message. When I run in debug (code snippet below)

prop = JDBC_Properties();
JDBC_setProp(prop: 'databaseName=': 'database name');
JDBC_setProp(prop: 'user=' : 'domain name\user'); (I've
also tried it with just the user name without the domain name)
JDBC_setProp(prop: 'password=' : 'password');

(Prop Values changed to protect the innocent)

conn = JDBC_ConnProp('com.microsoft.sqlserver.jdbc.SQLServerDriver'
:'java:jdbc:sqljdbc.jar:192.168.1.21:1433'
: prop );

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




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

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



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.