Can anyone suggest some good implementation examples or usage scenarios where SQL parsers can be used for java.
I have an application where we need to filter data to be presented on UI based on certain parameters, sort criteria etc. I have some doubts regarding this:
1)Can this be an ideal solution for this?
2)How can UI play an role for providing query to the Java layer?
Do you want to construct sql query dynamically in your java app and then fetch data using this sql? Let's say you have a sql like this:
after users pick up some other filters from UI, such as age > 40, then sql will be like this:
Of course, you maybe want to add more complicated filters or add sort clause as well.
In order to achieve this, a full SQL Parser is helpful, here is a demo that illustrate how to Deconstruct, Modify, Rebuild a SQL statement based on a Java SQL Parser.