On Java Development

All things related to Java development, from the perspective of a caveman.

Registering a JDBC driver may disable iSeries user profile

without comments

Back in September of 2004 a colleague was developing a Swing application and incorporated the DBConnection class into his project. The class was responsible for connection management to the AS/400, err … iSeries machine. With it, a problem arose during the time the user logged into the iSeries database using the JDBC connection. It appeared the process was mysteriously rendering the iSeries user profile as expired. Some circles, including the one we consider ourselves to be in, view that behavior as a problem. It was a real mystery and left us scratching our heads.

Consulting IBM, we discovered the problem; it was the way the driver was being registered, which is shown below.

The code appears benign enough; it creates a new driver and then registers the driver object using the DriverManager object. However, IBM explained that using the DriverManager class actually registered the driver a second time resulting in two drivers in the driver manager’s list.

As a consequence, when the user/developer was entering an invalid password for an unfortunate second time, it processed the signon event again with the second driver in the list as well and so counted that as the third invalid attempt. The user’s profile had been established so that it became invalid on the third invalid login attempt.

The remedy was simple enough; comment out the 2nd line.

Written by admin

March 30th, 2014 at 4:42 pm

Leave a Reply

You must be logged in to post a comment.