docs: public boolean validate() {
          int validationTimeout = dsConfig.get().validationTimeout;
  
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
          if (isTraceOn && tc.isEntryEnabled()) 
              Tr.entry(this, tc, "validate", "timeout: " + validationTimeout);
  
          try {
              if (validationTimeout >= 0 && mcf.jdbcDriverSpecVersion >= 40) // validation by timeout
              {
                  // Validation by timeout is available only on JDBC 4.0 & higher
                  if (!sqlConn.isValid(validationTimeout)) 
                  {
                      if (isTraceOn && tc.isEntryEnabled())
                          Tr.exit(this, tc, "validate", false);
                      return false;
                  }
              } else // validation by SQL query for JDBC drivers at spec level prior to v4.0
              {
                  Statement stmt = sqlConn.createStatement();
                  try {
                      stmt.executeQuery("SELECT 1").close(); // if this fails, the SQLException is checked for stale
                  } finally {
                      stmt.close();
                  }
              }
  
              //  - if currentAutoCommit is false, rollback the connection.
              if (!currentAutoCommit) {
                  if (isTraceOn && tc.isDebugEnabled()) 
                      Tr.debug(this, tc, "AutoCommit is false.  Rolling back the connection after validation");
                  sqlConn.rollback();
              }
  
              // Clean up the connection.
              mcf.helper.doConnectionCleanup(sqlConn);
  
              // Clear the warning.
              sqlConn.clearWarnings();
  
          } catch (SQLException sqle) {
              // No FFDC coded needed
  
              // The SQLException could be a StaleConnectionException or a normal SQLException
              // resulted from invalid SQLStatement.
  
              ResourceException resX = AdapterUtil.translateSQLException(sqle, this, false, getClass()); // no need to fire connection event here, J2C handles on pretest failure
  
              // Remove this if the helpers ever start tracing exceptions.
              if (isTraceOn && tc.isDebugEnabled()) 
                  Tr.debug(this, tc, "validate", AdapterUtil.getStackTraceWithState(sqle));
  
              if (helper.isConnectionError(sqle)) {
                  // Don't do any cleanup
                  if (isTraceOn && tc.isEntryEnabled())
                      Tr.exit(this, tc, "validate", false);
                  return false;
              } else if (!(resX instanceof SecurityException)) {
                  // This exception is due to an invalid SQL statement.
  
                  //  - if currentAutoCommit is false, rollback the connection.
                  if (!currentAutoCommit) {
                      try {
                          if (isTraceOn && tc.isDebugEnabled()) 
                              Tr.debug(this, tc, "AutoCommit is false.  Rolling back the connection after validation");
                          sqlConn.rollback();
                      } catch (SQLException rollbackEx) {
                          // No FFDC coded needed
  
                          // There is a possiblility that now the connection is stale.
  
                          if (helper.isConnectionError(rollbackEx)) {
                              if (isTraceOn && tc.isEntryEnabled())
                                  Tr.exit(this, tc, "validate", AdapterUtil.getStackTraceWithState(rollbackEx));
                              return false;
                          }
                      }
                  }
  
                  try {
                      mcf.helper.doConnectionCleanup(sqlConn);
                  } catch (SQLException cleanEx) {
                      // No FFDC coded needed
  
                      // There is a possiblility that now the connection is stale.
  
                      if (helper.isConnectionError(cleanEx)) {
                          if (isTraceOn && tc.isEntryEnabled())
                              Tr.exit(this, tc, "validate", AdapterUtil.getStackTraceWithState(cleanEx));
                          return false;
                      }
                  }
  
                  try {
                      sqlConn.clearWarnings();
                  } catch (SQLException cleanEx) {
                      // No FFDC coded needed
  
                      // There is a possibility that now the connection is stale.
  
                      if (helper.isConnectionError(cleanEx)) {
                          if (isTraceOn && tc.isEntryEnabled())
                              Tr.exit(this, tc, "validate", AdapterUtil.getStackTraceWithState(cleanEx));
                          return false;
                      }
                  }
              }
          }
  
          if (isTraceOn && tc.isEntryEnabled())
              Tr.exit(this, tc, "validate", true);
          return true;
      }