简体   繁体   中英

Get the table name of a specific column with ZQL or similar SQL parser for java

I have implemented a system that uses the ZQL library to parse sql statements and retrieve column names and table names.

Now I have got an additional requirement that requires me to find which column belongs to which table.

If anyone has previous experience of this either in ZQL library or some other SQL parsing library in java.Please respond

Immediate idea: take the results from you first implementation (parsing table and column names) and feed the data into a Map, where the column name is the key and the value is a set of table names (for a general approach, a column name may be used in more then one table)

Then you can do a get(columnName) and the map will give you the name(s) of the table(s).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM