Hello,
I'm doing one validator to SQL code.
The user will write some code and will return the result or the error. When one error is found i need to show the code, message and the position/line where the error is. But i don't know how get the position.
Where is what i'm doing now:
try { validator.checkSQL(sql2); } catch (EJBTransactionRolledbackException e) { e.printStackTrace(); Throwable t = e.getCause(); while (t != null) { if(t instanceof SQLGrammarException) { SQLGrammarException sqlexception = (SQLGrammarException) t; System.err.println(sqlexception.getErrorCode()); System.err.println(sqlexception.getSQLState()); System.err.println(sqlexception.getMessage()); break; } ...
SQLGrammarException don't have any method to get the Position. Someone knows if is possible get it? Thanks!
|