java 往oracle中插入SQL语句出现:“索引中丢失 IN 或 OUT 参数:: 1”
Stringsql="insertintoSTUDENT.YHBVALUES(STUDENT.UNO.NEXTVAL,?,?,?,?,?,?)";ps=conn.prep...
String sql = "insert into STUDENT.YHB VALUES(STUDENT.UNO.NEXTVAL,?,?,?,?,?,?)";
ps = conn.prepareStatement(sql);
//ps.setString(1,"33");
ps.setString(2,uid);
ps.setString(3,upw);
ps.setString(4,email);
ps.setString(5,safe);
ps.setString(6,answer);
ps.setString(7,sex);
int num = ps.executeUpdate();
其中:.UNO为ORACLE中创建的自动序列
错误:
java.sql.SQLException: 索引中丢失 IN 或 OUT 参数:: 1
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.driver.OracleStatement.checkBindsInAndOut(OracleStatement.java:1876)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2638)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
at YHB.Register.insert(Register.java:28)
at org.apache.jsp.showUser_jsp._jspService(showUser_jsp.java:193)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at 展开
ps = conn.prepareStatement(sql);
//ps.setString(1,"33");
ps.setString(2,uid);
ps.setString(3,upw);
ps.setString(4,email);
ps.setString(5,safe);
ps.setString(6,answer);
ps.setString(7,sex);
int num = ps.executeUpdate();
其中:.UNO为ORACLE中创建的自动序列
错误:
java.sql.SQLException: 索引中丢失 IN 或 OUT 参数:: 1
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.driver.OracleStatement.checkBindsInAndOut(OracleStatement.java:1876)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2638)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
at YHB.Register.insert(Register.java:28)
at org.apache.jsp.showUser_jsp._jspService(showUser_jsp.java:193)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询