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); }