IBM Support

Connection Failure with IBM Toolbox for Java JDBC Driver

Troubleshooting


Problem

The connection behavior of the IBM i Toolbox for Java JDBC driver (toolbox driver) behavior is different in JTOpen 6.3 (or PTF equivalent) running on a System i JVM. Invalid user ID / password combinations will no longer work. This document provides instructions for correcting programs that relied on this behavior, and provides a temporary circumvention.

Resolving The Problem

Behavior Change

After updating to JTOpen 6.3 (or PTF equivalent) on the System i, applications will no longer be able to establish a connection with invalid user ID combinations. The PTFs that introduce this behavior are:
  • SI32766 and SI32770 for V5R4
  • SI32768 and SI32772 for V6R1
  • Included in IBM i 7.1, 7.2 GA.

With these updates, the only accepted way to make a connection by using the current user profile is to pass in null values for the user profile and password. If an attempt is made to connect with an invalid user ID / password combination, the following error is received:

java.sql.SQLException: The application server rejected the connection. (The user ID or password contains a character that is not valid.)

The following code samples show acceptable ways of establishing a connection as the current user profile with the new behavior:

Example

connection = DriverManager.getConnection("jdbc:as400://localhost", null, null);

OR

connection = DriverManager.getConnection("jdbc:as400://localhost");

Circumvention

Anticipating that some applications might be relying on the previous behavior, toolbox introduced a JVM property that can be used to revert to the old behavior. This property was introduced in JTOpen 6.4 (or PTF equivalent). By default, this property has a value of true. Setting the property to false causes the previous behavior. Use of the property must be used as a temporary circumvention until the application can be corrected, as support for this property is dropped in a future version of JTOpen.

Property name: com.ibm.as400.access.JDBC.secureCurrentUser
Default value: true

[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CbKAAU","label":"Data Access-\u003EIBM i Toolbox for Java"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]

Historical Number

512471305

Document Information

Modified date:
10 January 2025

UID

nas8N1013251