Gets the exception that occurs when the sequence ID is checked to see if the Oracle database table ID field type is number type. If a long is modified to number. About number type: http://www.blogjava.net/caojianhua/archive/2011/01/24/343461.html severity: nulljava.sql.sqlexception The: ora-22816: returning clause does not support feature at oracle.jdbc.driver.sqlstatemapping.newsqlexception ( sqlstatemapping.java:70) at oracle.jdbc.driver.databaseerror.newsqlexception (DatabaseError.java:110) at oracle.jdbc.driver.databaseerror.throwsqlexception (databaseerror.java:171) at Oracle.jdbc.driver.T4CTTIoer.processError (t4cttioer.java:455) at oracle.jdbc.driver.t4cttioer.processerror (t4cttioer.java:413) at oracle.jdbc.driver.t4c8oall.receive (t4c8oall.java:1030) at Oracle.jdbc.driver.T4CPreparedStatement.doOall8 (t4cpreparedstatement.java:194) at Oracle.jdbc.driver.T4CPreparedStatement.executeForRows (t4cpreparedstatement.java:947) at Oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout (oraclestatement.java:1222) at Oracle.jdbc.driver.OraclePreparedStatement.executeInternal (oraclepreparedstatement.java:3381) At oracle.jdbc.driver.oraclepreparedstatement.executeupdate ( oraclepreparedstatement.java:3462) At oracle.jdbc.driver.oraclepreparedstatementwrapper.executeupdate ( oraclepreparedstatementwrapper.java:1061) at Org.iie.dao.impl.OracleGenelDaoImpl.insertDataReturnKeyByReturnInto (oraclegeneldaoimpl.java:160) at Org.iie.dao.impl.OracleGenelDaoImpl.main (oraclegeneldaoimpl.java:148)
By the way, the method of obtaining serial number is posted:
Public static int insertdatareturnkeybyreturninto () throws Exception { connection conn = globaldata.getoracleconnection (); String vsql = "Insert into xx (ID) values (xx_squencee.nextval) returning id into :1 "; OraclePreparedStatement pstmt = (oraclepreparedstatement) Conn.preparestatement (Vsql); pstmt.registerreturnparameter (1, types.bigint); pstmt.executeupdate (); resultset rs = pstmt.getreturnresultset (); rs.next (); int id = rs.getint (1);      &NBsp; rs.close (); pstmt.close (); system.out.print ("ID:" + id); return id; }
This article is from the "I Will work" blog, please be sure to keep this source http://meijia.blog.51cto.com/8684191/1586548
Oracle Exceptions: Features not supported by the returning clause