使用 usingGeneratedKeyColumns遇到的问题
来源:互联网 发布:子弹最快速度知乎 编辑:程序博客网 时间:2024/06/05 14:17
先记录一下。遇到要使用自动增长的序列时,添加数据可以先查询一下序列号,设置再插入
String s = "select nextval('seq_collection_0') ";
try {
int guid = getNamedParameterJdbcTemplate().queryForInt(s, Collections.EMPTY_MAP);
t.setGuid((long)guid);
Map<String, Object> paramMap = SCollectionRowMapper.putCollectionMap(t);
SimpleJdbcInsert simpleJdbcInsert = new SimpleJdbcInsert(getDataSource()).withTableName("s_collection_0")
.usingColumns("uid","type","remark","phone","parentid","name","luid","longitude","latitude","lasttime","guid",
"cityid","addtime","address");
return simpleJdbcInsert.execute(paramMap);
} catch (Exception e) {
return 0;
}
- 使用 usingGeneratedKeyColumns遇到的问题
- 使用replaceAll()遇到的问题
- 使用CVS遇到的问题
- 使用dom4j遇到的问题
- 使用dom4j遇到的问题
- 使用Maven遇到的问题
- 使用css遇到的问题
- TFS的使用遇到问题
- 使用selenium遇到的问题
- 使用 Ubuntu 遇到的问题
- 使用My97DatePicker 遇到的问题
- 使用iis遇到的问题
- 使用flashfxp遇到的问题
- 使用myeclipse遇到的问题
- 使用ScrollView遇到的问题
- 使用log4j遇到的问题
- 使用CKeditor遇到的问题
- VNC使用遇到的问题
- 多行文本框隐藏滚动条。
- mysql时间比较datetime
- HTML颜色代码表
- PHP 连接数据库前设置编码 --部分
- Oracle数据库优化器的优化方式
- 使用 usingGeneratedKeyColumns遇到的问题
- CSDN论坛帖子摘选 (1) -- 职业生涯规划
- 生成领料单(编号:20110704A1153)
- FusionCharts for jsp 的第一次亲密接触 搭建环境
- 转帖并消化:Android中一种使用AttributeSet自定义控件的方法
- Cortex-A series processors
- 数据库事务的四种特性
- RMI 学习笔记
- 老白对于RAC应用调优的建议--(摘自老白的ORACLE RAC 日记)