Parsing SQL Statements using java

后端 未结 5 2139
礼貌的吻别
礼貌的吻别 2021-01-06 18:44

I need to parse sql statements and get column names and table names. I tried with sample code. I got table names but I am stucked to get column names for each table.

5条回答
  •  盖世英雄少女心
    2021-01-06 18:55

    What you need is an SQL parser.

    You can try JSQLParser, or ZQL.

    I have used both successfully for the same thing the you are trying to do.

    You can try also sqlparser. This is commercial however and I have no experience using it.

提交回复
热议问题