Extract String and StringBuffer
- From: mikew01 <mikew01@xxxxxxxxxxxxxxxx>
- Date: Thu, 24 May 2012 01:29:25 -0700 (PDT)
Hi all
I need to extract all of the SQL select statements from a codebase ideally during build time.
The SQL queries are embedded in the source code in either String or StringBuffer form, none of them are annotated with a unique annotation.
I've been looking into AspectJ and maybe applying an aspect to the class Connection for instance which could output the sql to whereever at some point during execution, this does mean however that I'd need some way of executing each and every method which executes a select statement in a unit test for instance.
I've also briefly looked into AST as a possibility.
If the queries were annotated I could have used an annotation processor but alas they aren't.
Has anyone done this kind of thing before or can reccommend a suitable method?
Thanks
.
- Follow-Ups:
- Re: Extract String and StringBuffer
- From: Roedy Green
- Re: Extract String and StringBuffer
- From: Leif Roar Moldskred
- Re: Extract String and StringBuffer
- Prev by Date: Re: Ant 1.8.4 releeased
- Next by Date: Re: Extract String and StringBuffer
- Previous by thread: Ant 1.8.4 releeased
- Next by thread: Re: Extract String and StringBuffer
- Index(es):