I am writing a standalone Java program which makes JDBC
connection to a Websphere server
. Websphere app server already have Datasource configured (we using JCA) and its running fine.
Now, When I run my standalone code (from RAD/Eclipse) to get connection, it gives me error on line dataSource.getConnection();
error : java.sql.SQLException: invalid arguments in call DSRA0010E: SQL State = null, Error Code = 17,433
I searched for this error, many people suggested to pass user/pwd in connection like dataSource.getConnection(user, pwd)
. I did tried that and it worked fine. I am able to get the jdbc connection and my app works fine.
Problem: I can not pass hard coded user and password in my application. because usr/pwd can be changed in future or its a security breach.
Someone please suggest me. why its not able to pull connection through jca and why it need password?
` Properties localProperties = new Properties(); localProperties.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory"); localProperties.put(Context.PROVIDER_URL, "iiop://xxx.xx.xx.net:28035");
InitialContext localInitialContext = new InitialContext(localProperties); DataSource localDataSource = (DataSource)localInitialContext.lookup(datasource);
//localConnection = localDataSource.getConnection("user","mypwd"); // works fine localConnection = localDataSource.getConnection(); // Do not work `