Jdbc获取oracle中guid主键

时间:2014-05-08 11:48:52   收藏:0   阅读:518

上代码

bubuko.com,布布扣
String sql = "BEGIN  insert into itil_task_plan (PLAN_CODE)  values (?) returning id into ?; END;";
CallableStatement ps = conn.prepareCall(sql);
ps.setString(1, taskPlan.getPlanCode());
            
ps.registerOutParameter(2, Types.VARCHAR);
row = ps.executeUpdate();
String zhujian = ps.getString(2);
bubuko.com,布布扣

zhujian就是主键,用

CallableStatement 

Jdbc获取oracle中guid主键,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!