code: private void checkValidationSupport(final Connection connection) throws SQLException
     {
        try {
           if (isUseJdbc4Validation) {
              connection.isValid(1);
           }
           else {
              executeSql(connection, config.getConnectionTestQuery(), false);
           }
        }
        catch (Exception | AbstractMethodError e) {
           logger.error("{} - Failed to execute{} connection test query ({}).", poolName, (isUseJdbc4Validation ? " isValid() for connection, configure" : ""), e.getMessage());
           throw e;
        }
     }
docs: Check whether Connection.isValid() is supported, or that the user has test query configured.
  
  @param connection a Connection to check
  @throws SQLException rethrown from the driver