Search code examples
javajdbcibm-was

DefaultDataSource.getConnection(userID, password) Failing


I am working on WAS 6.1 to WAS 8.5.5 migration project (migrating JDK 1.5 to 1.7 as well ) and facing Database connectivity issue while switching project on WAS 8.5.5.

connection = defaultDataSource.getConnection(userID, password); Failing
java.sql.SQLException: ORA-01017: invalid username/password; logon denied DSRA0010E: SQL State = 72000, Error Code = 1,017

DataSource get Connection(userID, password) - connection is getting proper when we pass DB connection user ID and Password (Which we used in JAAS - J2C authentication data at server). But failing when we pass portal user ID and password. Same code is working on WAS 6.1 without any exception.

Getting proper connection with DataSource. getConnection() Method on WAS 8.5.5 The same code working in a different environment, but in this case when I call getConnection(userID, password) I get an exception. The datasource is WAS has the proper authentication alias set and when the connection is tested it works OK from the WAS side

I have used OJDBC6.jar (odbc4.1 which is supporting to WAS 8.5.5 ) but it application referring DataSource object from rt.jar of JRE lib.

Could you please guide me resolve this issue ?


Solution

  • What is the scope of the Datasource? If possible, could you attach or provide the security.xml file and resources.xml from the scope of the datasource. It sounds like their is a sync issue between the security.xml and the information presented in the Admin console.

    Please note, the test connection may provide different results depending on the scope of the datasource.

    Data source scope JVM where the test connection operation occurs Cell manager process Node Node agent process (of the relevant node) Cluster Node agent for each node that contains a cluster member Server Server; if the server is unavailable, the test connection operation is retried in the node agent for the node that contains the application server.

    If you have a cluster scoped datasource, the test connection is really being performed at the node agent. Thus, a failure at the server level, possibly in your case, isn't being test.

    Source: Knowledge Center

    For resolution, I would suggest stopping the JVMs and performing a manually sync using the syncNode command.