Hi is there any tool available in Java world that will parse/read a source file and pull SQL statements out in to a text file. This is a complex task given that you can write SQL statements in different fashion within the source (ex: using + sign or using .append()) or even conditional building of SQL.
Hi is there any tool available in Java world that will parse/read a source
Share
We’ve been considering doing this. This requires:
1) A full Java parser
2) Full control and data flow analysis, so that you can
track how values propagate through the code
3) Recognition of SQL (JDBC) calls, tracking data flows for the
SQL query back to their origins, and symbolically intrepreting the
set of operations along the data flow paths to determine
the apparant SQL operation.
The DMS Software Reengineering Toolkit is a generic engine for parsing langauges. DMS has a full Java front end (meets condition 1) that computes local control and global data data flow analysis (condition 2). DMS is configurable to extract code properties, so it could be configured we think to do 3. Still not a trivial task.
But alas, the requested tool is not available yet.