case Types.VARCHAR:
case BINARY: case TEXT: case OLE: case MEMO:
  public void copyTable(String name, ResultSet source) throws SQLException, IOException {    ResultSetMetaData md = source.getMetaData();    List<Column> columns = new LinkedList<Column>();    int textCount = 0;    int totalSize = 0;    for (int i = 1; i <= md.getColumnCount(); i++) {      switch (md.getColumnType(i)) {        case Types.INTEGER:        case Types.FLOAT:          totalSize += 4;          break;        case Types.DOUBLE:        case Types.DATE:          totalSize += 8;          break;        case Types.VARCHAR:          textCount++;          break;      }    }    short textSize = 0;    if (textCount > 0) {      textSize = (short) ((JetFormat.MAX_RECORD_SIZE - totalSize) / textCount);      if (textSize > JetFormat.TEXT_FIELD_MAX_LENGTH) {        textSize = JetFormat.TEXT_FIELD_MAX_LENGTH;      }    }    for (int i = 1; i <= md.getColumnCount(); i++) {      Column column = new Column();      column.setName(escape(md.getColumnName(i)));      column.setType(DataType.fromSQLType(md.getColumnType(i)));      if (column.getType() == DataType.TEXT) {        column.setLength(textSize);      }      columns.add(column);    }    createTable(escape(name), columns);    Table table = getTable(escape(name));    List<Object[]> rows = new ArrayList<Object[]>();    while (source.next()) {      Object[] row = new Object[md.getColumnCount()];      for (int i = 0; i < row.length; i++) {        row[i] = source.getObject(i + 1);      }      rows.add(row);      if (rows.size() == COPY_TABLE_BATCH_SIZE) {        table.addRows(rows);        rows.clear();      }    }    if (rows.size() > 0) {      table.addRows(rows);    }  }