jdbcTemplate 操作方法
- /**
- *1.方法一:
- */
- String sql = "select * from "+ tableName;
- //RowCountCallbackHandler rcch = new RowCountCallbackHandler();
- //this.jdbcTemplateDao.query(sql, rcch);
- //String[] coloumnName = rcch.getColumnNames();
- //int[] coloumnType = rcch.getColumnTypes();
- SqlRowSet sqlRowSet = this.jdbcTemplateDao.queryForRowSet(sql);
- SqlRowSetMetaData sqlRsmd = sqlRowSet.getMetaData();
- int columnCount = sqlRsmd.getColumnCount();
- for (int i = 1; i <= columnCount; i++) {
- Map<String,String> fieldMap = new HashMap<String,String>();
- fieldMap.put("name", sqlRsmd.getColumnName(i));
- fieldMap.put("