Hi,
I am looking for a SQL parser which should return me a JAVA object
representation of the input SQL components. I tried out the SQL Parser
which is provided as a part of Apache Jackrabbit project.
Repository repository = new TransientRepository();
Session session = repository.login();
SessionNamespaceResolver resolver = new SessionNamespaceResolver(session);
QueryRootNode queryRootNode = QueryParser.parse("select ename, dname
from emp , dept where dname = 1 and enaum = 2 and dname = enaum"
, Query.SQL,
resolver);
The last statement fails with InvalidQueryException. Even, using table
alias gives errors. However, the following input SQL works fine:
"select ename, dname from emp , dept where dname = 1 and enaum = 2".
I wanted to know as to what features of SQL are supported by this
Parser. Or, is there any other parser which I can use.
Please let me know if I am missing something here.
Thanks,
Ankit Goel