change use of StringBuffer to StringBuilder in generation of SQL