title: StringBuffer or StringBuilder for my query
body: <p>I understand first one is synchronized  and the later one is unsynchronized with faster response time.</p>
  
  <p>I am using <code>StringBuffer</code> for appending a SQL query. Transferring to <code>StringBuilder</code> would make it faster(<em>My question is especially in regards to SQL</em>)?</p>
  
  <p>Is it advisable to use <code>StringBuilder</code> around SQl query appending? </p>
  
  <p><strong>My Current Code</strong></p>
  
  <pre><code>public boolean saveData (Connection conn,MyObject) throws SQLException {
  ..
  PreparedStatement pstmt = null;
  ResultSet rs = null;
  try{
  StringBuffer sSubQry = new StringBuffer();                      
  sSubQry.append (" select ID, STATEID, TYPEID, LANGID, SEQ, ");
  sSubQry.append (" SECTIONSEQ, CODE, NAME, INPUTNAME, ");
  sSubQry.append (" .., .., ..,");
  sSubQry.append (" .., .., ..,");
  ..
  ..
  pstmt = conn.prepareStatement(sSubQry.toString());
  rs = pstmt.executeQuery();
  while (rs.next ())
   {
   ..
   }
  }
  </code></pre>
  
  <p>By transferring it to <code>StringBuilder</code> have any <code>+ve</code> or <code>-ve</code> effects</p>
  
  <pre><code>public boolean saveData (Connection conn,MyObject) throws SQLException {
  ..
  PreparedStatement pstmt = null;
  ResultSet rs = null;
  try{
  StringBuilder sSubQry = new StringBuilder();                        
  sSubQry.append (" select ID, STATEID, TYPEID, LANGID, SEQ, ");
  sSubQry.append (" SECTIONSEQ, CODE, NAME, INPUTNAME, ");
  sSubQry.append (" .., .., ..,");
  sSubQry.append (" .., .., ..,");
  ..
  pstmt = conn.prepareStatement(sSubQry.toString());
  rs = pstmt.executeQuery();
  while (rs.next ())
   {
   ..
   }
  }
  </code></pre>