0 Replies Latest reply on Nov 27, 2002 4:39 PM by Kyley Jex

    How to get second JDBC connection within EJB?

    Kyley Jex Newbie

      Within my SFSB I create my initial Oracle JDBC connection in the ejbCreate method. However, within a particular method a connection as a different user needs to be created. Actually what the method does is: 1) create a new schema user, 2) connect as that user and create some tables, 3) disconnect from the new user.

      The call to "DataSource.getConnection(newUser, newPassword)" produces the following error. javax.ejb.EJBException: Failure to get Connection: Wrong credentials passed to getConnection!; - nested throwable: (javax.resource.ResourceException: Wrong credentials passed to getConnection!)

      Any ideas on what I'm not configuring correctly? I do have the oracle-service.xml defined for my connection factory. I'm not using a login configuration as defined in login-config.xml. Does that matter? I couldn't get it to even create my initial connection -- I assumed that I was missing something else too.

      Kyley Jex