docs: private final Connection getConnectionUsingDS(String userN, String password, final WSConnectionRequestInfoImpl cri) throws ResourceException 
      {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
          if (isTraceOn && tc.isEntryEnabled())
              Tr.entry(this, tc, "getConnectionUsingDS", AdapterUtil.toString(dataSourceOrDriver), userN);
  
          final String user = userN == null ? null : userN.trim();
          final String pwd = password == null ? null : password.trim();
  
          Connection conn = null;
          boolean isConnectionSetupComplete = false;
          try {
              conn = AccessController.doPrivileged(new PrivilegedExceptionAction<Connection>() {
                  public Connection run() throws Exception {
                      boolean buildConnection = cri.ivShardingKey != null || cri.ivSuperShardingKey != null;
                      if (!buildConnection && dataSourceOrDriver instanceof XADataSource) {
                          // TODO this code path is very suspect, and so we are not continuing it for connection builder path.
                          // Why convert what was requested to be a DataSource to XADataSource?
                          // And then it also leaks the XAConnection. It is not tracked, so it never gets closed! 
                          return user == null ? ((XADataSource) dataSourceOrDriver).getXAConnection().getConnection()
                                              : ((XADataSource) dataSourceOrDriver).getXAConnection(user, pwd).getConnection();
                      } else {
                          return buildConnection ? jdbcRuntime.buildConnection((DataSource) dataSourceOrDriver, user, pwd, cri)
                                          : user == null ? ((DataSource) dataSourceOrDriver).getConnection()
                                                          : ((DataSource) dataSourceOrDriver).getConnection(user, pwd);
                      }
                  }
              });
  
              try {
                  postGetConnectionHandling(conn);
              } catch (SQLException se) {
                  FFDCFilter.processException(se, getClass().getName(), "260", this);
                  if (isTraceOn && tc.isEntryEnabled())
                      Tr.exit(this, tc, "getConnectionUsingDS", se);
                  throw AdapterUtil.translateSQLException(se, this, false, getClass()); 
              }
  
              isConnectionSetupComplete = true;
          } catch (PrivilegedActionException pae) {
              FFDCFilter.processException(pae.getException(), getClass().getName(), "1372");
              ResourceException resX = new DataStoreAdapterException("JAVAX_CONN_ERR", pae.getException(), getClass(), "Connection");
              if (isTraceOn && tc.isEntryEnabled())
                  Tr.exit(this, tc, "getConnectionUsingDS", pae.getException());
              throw resX;
          } catch (ClassCastException castX) {
              // There's a possibility this occurred because of an error in the JDBC driver
              // itself.  The trace should allow us to determine this.
              FFDCFilter.processException(castX, getClass().getName(), "1312");
              ResourceException resX = new DataStoreAdapterException("NOT_A_1_PHASE_DS", null, getClass(), castX.getMessage());
              if (isTraceOn && tc.isEntryEnabled())
                  Tr.exit(this, tc, "getConnectionUsingDS", castX);
              throw resX;
          } finally {
              // Destroy the connection if we weren't able to successfully complete the setup.
              if (conn != null && !isConnectionSetupComplete)
                  try {
                      conn.close();
                  } catch (Throwable x) {
                  }
          }
  
          if (isTraceOn && tc.isEntryEnabled())
              Tr.exit(this, tc, "getConnectionUsingDS", AdapterUtil.toString(conn));
          return conn;
      }