WAS JDBC Connection Pool Data Source problem....DSRA0010E: SQLState = 08004 - Websphere

This is a discussion on WAS JDBC Connection Pool Data Source problem....DSRA0010E: SQLState = 08004 - Websphere ; The problem is 1. I have setting up a data source on WAS, and if I test it from the WAS admin console,and it's ok. 2.I use below try to get the pooled connection from WAS, I can get the ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: WAS JDBC Connection Pool Data Source problem....DSRA0010E: SQLState = 08004

  1. WAS JDBC Connection Pool Data Source problem....DSRA0010E: SQLState = 08004

    The problem is
    1. I have setting up a data source on WAS, and if I test it from the WAS admin console,and it's ok.
    2.I use below try to get the pooled connection from WAS, I can get the DataSource but once I try to get the Connection from the DataSource , it failed with error as below, it looks like I did not set the user/password for my connection pool...
    -----------------------------------------------------------------------
    java.sql.SQLException: The application server rejected the connection. (Password is not set.)DSRA0010E: SQL State = 08004???? = -99,999DSRA0010E: SQL State = 08004???? = -99,999
    ------------------------------------------------------------------------

    3.I check the WAS JCA setting again, and it's ok, and I still can connect to the DB from WAS, if I test it from WAS Admin console...
    -------------------------------------------------------------------------
    env.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
    env.put(Context.PROVIDER_URL, "corbaloc:iiop:localhost:2809");
    Context initialContext = new InitialContext(env);
    DataSource ds = (DataSource) initialContext.lookup('JNDI Name for my pool');
    Connection conn = ds.getConnection();
    ----------------------------------------------------------------------






  2. Re: WAS JDBC Connection Pool Data Source problem....DSRA0010E: SQLState = 08004

    andrewwang1@yahoo.com wrote:
    > The problem is
    > 1. I have setting up a data source on WAS, and if I test it from the WAS admin console,and it's ok.
    > 2.I use below try to get the pooled connection from WAS, I can get the DataSource but once I try to get the Connection from the DataSource , it failed with error as below, it looks like I did not set the user/password for my connection pool...
    > -----------------------------------------------------------------------
    > java.sql.SQLException: The application server rejected the connection. (Password is not set.)DSRA0010E: SQL State = 08004???? = -99,999DSRA0010E: SQL State = 08004???? = -99,999
    > ------------------------------------------------------------------------
    >
    > 3.I check the WAS JCA setting again, and it's ok, and I still can connect to the DB from WAS, if I test it from WAS Admin console...
    > -------------------------------------------------------------------------
    > env.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
    > env.put(Context.PROVIDER_URL, "corbaloc:iiop:localhost:2809");
    > Context initialContext = new InitialContext(env);
    > DataSource ds = (DataSource) initialContext.lookup('JNDI Name for my pool');
    > Connection conn = ds.getConnection();
    > ----------------------------------------------------------------------
    >
    >
    >
    >
    >


    Testing from the admin console doesn't actually try to do a transaction,
    so if the password's not set it may not fail.

    How did you configure the password on your DataSource?

    Ken

  3. Re: WAS JDBC Connection Pool Data Source problem....DSRA0010E:SQL<br> State = 08004

    1. Yes, I think the connection pool is ok because I have a servlet which can connect to DB via WAS pooled connection.

    2. First, I create a J2C item(in the screen I can input the user name and password), then in the J2C item of WAS datasource screen, I select it.

  4. Re: WAS JDBC Connection Pool Data Source problem....DSRA0010E: SQL<br>State = 08004

    andrewwang1@yahoo.com wrote:
    > 1. Yes, I think the connection pool is ok because I have a servlet which can connect to DB via WAS pooled connection.
    >
    > 2. First, I create a J2C item(in the screen I can input the user name and password), then in the J2C item of WAS datasource screen, I select it.


    Your config sounds right. Can your servlet get a connection
    successfully? where is the code that's failing running?

    Ken

  5. Re: WAS JDBC Connection Pool Data Source problem....DSRA0010E:SQL<br><br> State = 08004

    1. Yes, the servlet can get a connection successful and also retrieve ResultSet return by SQL select statement

    2. The code failed at retrieving the Connection from DataSource.
    // This OK...
    DataSource ds = (DataSource) initialContext.lookup("jdbc/DB2_UDB_TEST");
    // Failed at this...
    Connection conn = ds.getConnection();

    Andrew

  6. Re: DSRA0010E: SQLState = 08004

    Solution is to use getConnection('user','password'). During my testing the JCA setting on WAS datasources does not seem to work. I had to explicitly specify the user/password in the getConnection method to get this going in WAS 6

+ Reply to Thread