title: java.sql.SQLSyntaxErrorException: ORA-01795: maximum number of expressions in a list is 1000
body: <p>we all know we see this exception when try to bomabard the query with more than 1000 values. the maximum for the column  limit is 1000..  the best possible solution is to split the query into two.guys can u suggest some possible ways of code refactoring to make my problem go away.any help would be appreciated.</p>
  
  <p>we see the exception when <strong>audTypeFieldIdList</strong> are greater than 1000 values.</p>
  
  <pre><code>try {
          String query = "select AUDIT_TYPE_FIELD_ID, FIELD_NAME from AUDIT_TYPE_FIELD where AUDIT_TYPE_FIELD_ID in (";
          int x = 0;
          for (int y = 1; y &lt;= audTypeFieldIdList.size(); y++) {
              query += audTypeFieldIdList.get(x);
              if (y != audTypeFieldIdList.size()) {
                  query += ", ";
              }
              x++;
          }
          query += ")";    
  
  
  
  List&lt;Long&gt; audTypeFieldIdList, Connection connection) {          
  
      ResultSet rs = null;
      Statement stmt = null;
      List&lt;AuditTypeField&gt; audTypeFieldList = new ArrayList&lt;AuditTypeField&gt;();
      try {
          String query = "select AUDIT_TYPE_FIELD_ID, FIELD_NAME from AUDIT_TYPE_FIELD where AUDIT_TYPE_FIELD_ID in (";
          int x = 0;
          for (int y = 1; y &lt;= audTypeFieldIdList.size(); y++) {
              query += audTypeFieldIdList.get(x);
              if (y != audTypeFieldIdList.size()) {
                  query += ", ";
              }
              x++;
          }
          query += ")";
  
  
  
          stmt = connection.createStatement();
          rs = stmt.executeQuery(query);
          while (rs != null &amp;&amp; rs.next()) {
              AuditTypeField audTypeField = PluginSystem.INSTANCE
                      .getPluginInjector().getInstance(AuditTypeField.class);
              audTypeField.setId(rs.getLong("AUDIT_TYPE_FIELD_ID"));
              audTypeField.setName(rs.getString("FIELD_NAME"));
              audTypeFieldList.add(audTypeField);
          }
          return audTypeFieldList;
          return audTypeFieldList;
  </code></pre>