Validator (Apache Tomcat 10.1.48 API Documentation)
Description: declaration: package: org.apache.tomcat.jdbc.pool, interface: Validator

# Interface Validator

public interface Validator
Interface to be implemented by custom validator classes.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `validate(Connection connection, int validateAction)`
  Validate a connection and return a boolean to indicate if it's valid.

- ## Method Details

  - ### validate

    boolean validate(Connection connection, int validateAction)
    Validate a connection and return a boolean to indicate if it's valid.
    Parameters:
      `connection` - the Connection object to test
      `validateAction` - the action used. One of `PooledConnection.VALIDATE_BORROW`, `PooledConnection.VALIDATE_IDLE`, `PooledConnection.VALIDATE_INIT` or `PooledConnection.VALIDATE_RETURN`
    Returns:
      true if the connection is valid