Package org.gvsig.app.sqlQueryValidation
Class SQLQueryValidation
java.lang.Object
org.gvsig.app.sqlQueryValidation.SQLQueryValidation
Class for validate a complete query or the sentence of a query from WHERE
- Author:
- Pablo Piqueras Bartolomé (p_queras@hotmail.com)
-
Constructor Summary
ConstructorsConstructorDescriptionSQLQueryValidation(String _query, boolean _onlyWhereStatement) Default constructor with a parameter -
Method Summary
Modifier and TypeMethodDescriptionReturns an string with an error message if there has been an error, or 'null' if there hasn't beenint[]Returns the error position (line, column) or (-1, -1) if there hasn't been any errorReturns an string with a text describing the (first) position of the errorReturns the token where the validator failedbooleanValidates a query Returns 'null' if there has been some error
-
Constructor Details
-
SQLQueryValidation
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
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
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
Returns the token where the validator failed- Returns:
- An string
-