The answer partly depends on what kind of application you are creating.
If it is a Eclipse plugin application (that is, takes full advantage
of the Eclipse plugin environment) then I can send you some sample code.
If it's an RCP app. or a stand-alone Java app., then it will be more
difficult because of some plugin dependency issues.
Once you have the parser working, then you can use the "Helper" classes
in plugin org.eclipse.datatools.modelbase.sql.query to get whatever
information you need from the parsed query statement. For example,
"getTablesForStatement(QueryStatement stmt)" in the StatementHelper class.
> I'm using the sql parser provided into the DTP package.
> I'm trying to do a very simple execise: get the table name from a sql
> code. This could be:
> question: select attribute from mytable
> answer: mytable
> I suppose that i can get it using the QuerySelect.getFromClause method,
> but I don't know how to parse an statement and get the QuerySelect from it.
> Can anyone help me?, thanks.