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



I had a similar problem (minus the JNI aspects, but they aren't
relevant). Same error message. I found out after some tedious googling
that even if you configure the driver to not use SSL, it still tries to
use SSL to make the initial connection (before authentication). And
there's some iSeries angle which causes this to not work. There weren't
any easy fixes in the Google results and I didn't want to descend into
the hell of configuring SSL on the iSeries. So I downloaded the JTDS
driver for MS-SQL (from Sourceforge if I recall correctly) and used it
instead. Works fine, no problems.

PC2

-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
[mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Larry Ducie
Sent: January 7, 2009 17:07
To: java400-l@xxxxxxxxxxxx
Subject: Problem when accessing MS SQL database from RPG using JNI - SSL


Hi Guys,

I am currently working on a RPG program which uses JDBC, via JNI, to
connect to a MS SQL database.

The basic program and supporting service program was provided in an
article by Skott Klement:
http://systeminetwork.com/article/access-ms-sql-server-database-rpg-prog
ram

I have installed the driver and attempted to connect to the database -
the connection is attempted by I get the following errors:

8/01/2009 10:27:11 com.microsoft.sqlserver.jdbc.TDSChannel enableSSL

WARNING: TDSChannel ( ConnectionID:1 TransactionID:0x0000000000000000)
SSL handshake failed: null
com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not
establish a secure connection to SQL Server by using Secure
Sockets Layer (SSL) encryption. Error: null.

at java.lang.Throwable.<init>(Throwable.java:195)

at java.lang.Exception.<init>(Exception.java:41)

at java.sql.SQLException.<init>(SQLException.java:40)

at
com.microsoft.sqlserver.jdbc.SQLServerException.<init>(Unknown Source)

at
com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(Unknown
Source)
at
com.microsoft.sqlserver.jdbc.TDSChannel.throwSSLConnectionFailed(Unknown
Source)
at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(Unknown
Source)
at
com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown
Source)
at
com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Un
known Source)
at
com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)

at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown
Source)

Can anybody give me some insight into what is failing here? We use SSL
for other woprk so I'm certain it is configured correctly on our System
i.

Here are some salient points of info:

java version:

java version "1.4.2"

Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_16-b05)

Classic VM (build 1.4, build JDK-1.4, native threads, jitc_de)


RPG Code:
D connectString s 256A
inz('jdbc:sqlserver://XXXX:1433')


prop = JDBC_Properties();
JDBC_setProp(prop: 'userName' : 'xxxx');
JDBC_setProp(prop: 'password' : 'xxxx');
JDBC_setProp(prop: 'databaseName' : 'xxxx');

conn =
JDBC_ConnProp('com.microsoft.sqlserver.jdbc.SQLServerDriver'
:%trim(connectString)
: prop );

Is the SQL server not listening on secure sockets? Can I try to connect
without using SSL? Any ideas would be great!

Cheers

Larry Ducie



_________________________________________________________________
Time for change? Find your ideal job with SEEK.
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fninemsn%2Eseek%2Ecom%2Ea
u%2F%3Ftracking%3Dsk%3Atl%3Ask%3Anine%3A0%3Ahottag%3Achange&_t=757263783
&_r=SEEK_tagline&_m=EXT
--
This is the Java Programming on and around the iSeries / AS400
(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.


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.