Loading

jdbc读取新插入Oracle数据库Sequence值的5种方法

http://www.360doc.com/content/11/1102/17/1290342_161130566.shtml

自己测试的代码:

            OraclePreparedStatement ops = (OraclePreparedStatement) conn.prepareStatement(sql);
            ops.setString(1, "asdf");
            ops.registerReturnParameter(2, OracleTypes.INTEGER);
            ops.executeUpdate();
            ResultSet resultSet = ops.getReturnResultSet();
            while(resultSet.next()){
                int int1 = resultSet.getInt(1);
                System.out.println(int1);
            }

 

posted @ 2015-06-30 14:46  stono  阅读(260)  评论(0编辑  收藏  举报