Class SQLQueryValidation

java.lang.Object
org.gvsig.app.sqlQueryValidation.SQLQueryValidation

public class SQLQueryValidation extends Object
Class for validate a complete query or the sentence of a query from WHERE
Author:
Pablo Piqueras Bartolomé (p_queras@hotmail.com)
  • Constructor Details

    • SQLQueryValidation

      public SQLQueryValidation(String _query, boolean _onlyWhereStatement)
      Default constructor with a parameter
      Parameters:
      _query - The query to validate
      _onlyWhereStatement - If the query is only the part of WHERE ... in a query
  • Method Details

    • validateQuery

      public boolean validateQuery()
      Validates a query Returns 'null' if there has been some error
    • getErrorMessage

      public String getErrorMessage()
      Returns an string with an error message if there has been an error, or 'null' if there hasn't been
      Returns:
      An string or null
    • getErrorPositionAsMessage

      public String getErrorPositionAsMessage()
      Returns an string with a text describing the (first) position of the error
      Returns:
      An string or null
    • getErrorPosition

      public int[] getErrorPosition()
      Returns the error position (line, column) or (-1, -1) if there hasn't been any error
      Returns:
      An array of 2 integer values (first: line, second: column)
    • getTokenThatProducedTheSyntacticError

      public String getTokenThatProducedTheSyntacticError()
      Returns the token where the validator failed
      Returns:
      An string