LOG.warn("Flushing PreparedStatement batch for table " + name + " (" + insertCount + " inserts)");
long beforeFlush = System.currentTimeMillis();
    protected void doInserts(String name, TableBatch table) throws SQLException {        String colNames[] = table.getColNames();        if ((colNames != null) && (!table.getIdsToInsert().isEmpty())) {            StringBuffer sqlBuffer = new StringBuffer("INSERT INTO ").append(name).append(" (");            for (int i = 0; i < colNames.length; i++) {                if (i > 0) {                    sqlBuffer.append(", ");                }                sqlBuffer.append(colNames[i]);            }            sqlBuffer.append(") VALUES (");            for (int i = 0; i < colNames.length; i++) {                if (i > 0) {                    sqlBuffer.append(", ");                }                sqlBuffer.append("?");            }            sqlBuffer.append(")");            String sql = sqlBuffer.toString();            PreparedStatement prepS = con.prepareStatement(sql);            int insertCount = 0;            Iterator insertIter = table.getIdsToInsert().entrySet().iterator();            while (insertIter.hasNext()) {                Map.Entry insertEntry = (Map.Entry) insertIter.next();                Object values[] = (Object[]) insertEntry.getValue();                for (int i = 0; i < colNames.length; i++) {                    prepS.setObject(i + 1, values[i]);                }                prepS.addBatch();                insertCount++;            }            LOG.warn("Flushing PreparedStatement batch for table " + name + " (" + insertCount                    + " inserts)");            prepS.executeBatch();            table.getIdsToInsert().clear();        }    }