Search in sources :

Example 1 with ParseException

use of net.sf.jsqlparser.parser.ParseException in project herddb by diennea.

the class JSQLParserPlanner method parseStatement.

private net.sf.jsqlparser.statement.Statement parseStatement(String query) throws StatementExecutionException {
    net.sf.jsqlparser.statement.Statement stmt;
    CCJSqlParser parser = new CCJSqlParser(new StringProvider(query));
    // parser.setErrorRecovery(true);
    try {
        return parser.Statement();
    } catch (ParseException err) {
        throw new StatementExecutionException("unable to parse query " + query, err);
    }
}
Also used : StringProvider(net.sf.jsqlparser.parser.StringProvider) CCJSqlParser(net.sf.jsqlparser.parser.CCJSqlParser) ParseException(net.sf.jsqlparser.parser.ParseException) StatementExecutionException(herddb.model.StatementExecutionException)

Aggregations

StatementExecutionException (herddb.model.StatementExecutionException)1 CCJSqlParser (net.sf.jsqlparser.parser.CCJSqlParser)1 ParseException (net.sf.jsqlparser.parser.ParseException)1 StringProvider (net.sf.jsqlparser.parser.StringProvider)1