Chinaunix首页 | 论坛 | 博客
  • 博客访问: 182556
  • 博文数量: 92
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1413
  • 用 户 组: 普通用户
  • 注册时间: 2013-02-04 21:12
文章分类
文章存档

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());
}
}); ; 
阅读(512) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~