× 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'm finally making enough progress with my JDBCR4 project to where I need to concern myself with users entering a wrong user-ID and/or password: when this happens,
conn = JDBC_ConnProp(%trim(driver)
: %trim(url_db)
: prop );
throws a Java exception. (There are almost certainly other ways to make it throw an exception; bad values for driver or url_db spring immediately to mind.)

With some futzing around, I was able to redirect stdout and stderr to source PFs in QTEMP, and I got this in STDERR:
Exception in thread "main" java.sql.SQLException: The application server rejecte
d the connection. (User ID is not known.)
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:558)
at com.ibm.as400.access.AS400JDBCConnection.setProperties(AS400JDBCConnection.j
ava:3328)
at com.ibm.as400.access.AS400JDBCDriver.prepareConnection(AS400JDBCDriver.java:
1393)
at com.ibm.as400.access.AS400JDBCDriver.initializeConnection(AS400JDBCDriver.ja
va:1230)
at com.ibm.as400.access.AS400JDBCDriver.connect(AS400JDBCDriver.java:371)
Caused by: com.ibm.as400.access.AS400SecurityException: User ID is not known.
at com.ibm.as400.access.AS400ImplRemote.returnSecurityException(AS400ImplRemote
.java:1767)
at com.ibm.as400.access.AS400ImplRemote.signon(AS400ImplRemote.java:2277)
at com.ibm.as400.access.AS400.sendSignonRequest(AS400.java:3051)
at com.ibm.as400.access.AS400.promptSignon(AS400.java:2615)
at com.ibm.as400.access.AS400.signon(AS400.java:3930)
at com.ibm.as400.access.AS400.connectService(AS400.java:1178)
at com.ibm.as400.access.AS400JDBCConnection.setProperties(AS400JDBCConnection.j
ava:3324)
... 3 more

Now, obviously, if I were doing this in Java, I'd put it in a try/catch block. But what about calling from RPG?

--
JHHL

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.