2013年(92)
分类: 信息化
2013-02-28 05:30:55
[代码] [Java]代码 //存储clob数据类型,参阅代码 //配置文件 //代码完成参阅 ?private @Autowired LobHandler lobHandle ; r; ?? String sql = "insert into order(id,content) values(?,?)"; final Reader reader=new StringReader(content); jdbcTemplate.execute(sql, new AbstractLobCreatingPreparedStatementCallback(this.lobHandler) { @Override protected void setValues(PreparedStatement ps, LobCreator lobCreator) throws SQLException, DataAccessException { ps.setString(1, orderId); lobCreator.setClobAsCharacterStream(ps, 2, reader, content.length()); } }); ;