question: private String transformSQLCase ( String sql ) { StringBuilder s = new StringBuilder ( sql ) ; try { PositionedStringReader r = new PositionedStringReader ( sql ) ; StreamTokenizer st = new StreamTokenizer ( r ) ; st . resetSyntax ( ) ; for ( char quote : valueQuotes ) st . quoteChar ( quote ) ; int start = 0 ; int end = 0 ; while ( st . nextToken ( ) != StreamTokenizer . TT_EOF ) { if ( end < ( r . getCurrentPosition ( ) - 1 ) || r . getCurrentPosition ( ) >= ( sql . length ( ) ) ) { String str = sql . substring ( start , end + 1 ) ; str = transformCase ( str ) ; s . replace ( start , end + 1 , str ) ; start = r . getCurrentPosition ( ) ; } end = r . getCurrentPosition ( ) ; } } catch ( IOException e ) { logger . warn ( "Unexpected exception while transforming SQL statement case: " + e ) ; } return s . toString ( ) ; }
target:  Transforms case of a whole SQL statement except values in quotes.