Parser to parse an SQL query and return the column name's and the corresponding table name in Java [duplicate]
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: SQL parser library for Java I need a parser that should return me column names with their corresponding table names in the format column_name table_name Preferably a java library, that can make the implementation easier as I dont want to get into all the nuances of SQL parsing. regards, 回答1: If you have a connection to the database, you can do that using a prepared statement: String sql = "....";