开发者

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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜