private String buildSql() throws SQLException {
  StringBuilder sb=new StringBuilder();
  for (int i=0; i < sqlAndParams.length; i++)   try {
    if (sqlAndParams[i] instanceof Date) {
      sb.append("'" + dateFormat.format((Date)sqlAndParams[i]) + "' ");
    }
 else {
      sb.append(sqlAndParams[i] + " ");
    }
  }
 catch (  Exception e) {
    throw new SQLException("Unable to create SQL statement, [" + i + "] = "+ sqlAndParams[i]+ " : "+ e.getMessage(),e);
  }
  return sb.substring(0,sb.length() - 2);
}

private String buildSql ( ) throws SQLException { StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < sqlAndParams . length ; i ++ ) try { if ( sqlAndParams [ i ] instanceof Date ) { sb . append ( "'" + dateFormat . format ( ( Date ) sqlAndParams [ i ] ) + "' " ) ; } else { sb . append ( sqlAndParams [ i ] + " " ) ; } } catch ( Exception e ) { throw new SQLException ( "Unable to create SQL statement, [" + i + "] = " + sqlAndParams [ i ] + " : " + e . getMessage ( ) , e ) ; } return sb . substring ( 0 , sb . length ( ) - 2 ) ; }
builds the final sql statement
