String sql = "select column_name,column_type,column_default,column_key,column_comment,is_nullable,extra from columns where table_schema='"
+ db + "' and table_name='" + tablename + "'";
List<CmsField> fields = new ArrayList<CmsField>();
SqlRowSet set = getJdbcTemplate().queryForRowSet(sql);
while (set.next()) {
CmsField field = new CmsField();
field.setName(set.getString(1));
field.setFieldType(set.getString(2));
field.setFieldDefault(set.getString(3));
field.setFieldProperty(set.getString(4));
field.setComment(set.getString(5));
field.setNullable(set.getString(6));
field.setExtra(set.getString(7));
fields.add(field);
}
return fields;
}