Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AS400JDBCDataDatasource not using password property #157

Closed
jeber-ibm opened this issue Jan 26, 2024 · 1 comment · Fixed by #158
Closed

AS400JDBCDataDatasource not using password property #157

jeber-ibm opened this issue Jan 26, 2024 · 1 comment · Fixed by #158
Assignees

Comments

@jeber-ibm
Copy link
Member

When setting the properties for an AS400JDBCDataSource, the password in the properties object is not being used.

The exception looks like the following.

java.lang.NullPointerException: password
at com.ibm.as400.access.AS400.checkPasswordNullAndLength(AS400.java:4860)
at com.ibm.as400.access.AS400.setPassword(AS400.java:4267)
at com.ibm.as400.access.AS400JDBCDataSource.setPassword(AS400JDBCDataSource.java:3594)
at com.ibm.as400.access.AS400JDBCDataSource.setProperties(AS400JDBCDataSource.java:3836)

The problem can be created by using the following.

java -jar jt400.jar jdbc:as400:somehost userid password
!PRINTSTACKTRACE true
!setnewvar properties=java.util.Properties()
!setnewvar dataSource = com.ibm.as400.access.AS400JDBCConnectionPoolDataSource()
!callmethod properties.put("user", userid)
!callmethod properties.put("password", password)
!callmethod dataSource.setProperties(properties)

@jeber-ibm
Copy link
Member Author

Corresponding test issue is IBM/JTOpen-test#63

@jeber-ibm jeber-ibm linked a pull request Jan 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant