Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #14767

Extract String and StringBuffer

From mikew01 <mikew01@blueyonder.co.uk>
Newsgroups comp.lang.java.programmer
Subject Extract String and StringBuffer
Date 2012-05-24 01:29 -0700
Organization http://groups.google.com
Message-ID <34c76a08-4bdb-462b-9178-c8a24d9a5dba@googlegroups.com> (permalink)

Show all headers | View raw


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

Back to comp.lang.java.programmer | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Extract String and StringBuffer mikew01 <mikew01@blueyonder.co.uk> - 2012-05-24 01:29 -0700
  Re: Extract String and StringBuffer Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-05-24 04:02 -0500
    Re: Extract String and StringBuffer mikew01 <mikew01@blueyonder.co.uk> - 2012-05-24 03:21 -0700
      Re: Extract String and StringBuffer markspace <-@.> - 2012-05-24 08:21 -0700
        Re: Extract String and StringBuffer Roedy Green <see_website@mindprod.com.invalid> - 2012-05-28 09:28 -0700
          Re: Extract String and StringBuffer markspace <-@.> - 2012-05-28 12:19 -0700
      Re: Extract String and StringBuffer Robert Klemme <shortcutter@googlemail.com> - 2012-05-24 08:20 -0700
        Re: Extract String and StringBuffer markspace <-@.> - 2012-05-24 08:47 -0700
          Re: Extract String and StringBuffer Lew <lewbloch@gmail.com> - 2012-05-24 09:52 -0700
      Re: Extract String and StringBuffer Martin Gregorie <martin@address-in-sig.invalid> - 2012-05-24 20:29 +0000
  Re: Extract String and StringBuffer Roedy Green <see_website@mindprod.com.invalid> - 2012-05-28 09:29 -0700

csiph-web