读书人

CLOB跟BLOB的字段录入和读取

发布时间: 2012-07-03 13:37:43 作者: rapoo

CLOB和BLOB的字段录入和读取
存储操作

List<Map<String, Object>> l = jdbcTemplate.query(  "select id, a_clob, a_blob from lob_table",  new RowMapper<Map<String, Object>>() {    public Map<String, Object> mapRow(ResultSet rs, int i) throws SQLException {      Map<String, Object> results = new HashMap<String, Object>();      String clobText = lobHandler.getClobAsString(rs, "a_clob");      results.put("CLOB", clobText);      byte[] blobBytes = lobHandler.getBlobAsBytes(rs, "a_blob");      results.put("BLOB", blobBytes);      return results;    }  });

读书人网 >开源软件

热点推荐