?= call proc (? , ?),如果我知道这个proc返回一个整型值,如何取得这个值?
2 个解决方案
#1
try something like
CallableStatement callStmt;
callStmt = dbConnection.prepareCall("{? = call proc (?, ?) }");
callStmt.registerOutParameter(1, java.sql.Types.INTEGER);
.....
callStmt.executeUpdate();
callStmt.getInt(1);
CallableStatement callStmt;
callStmt = dbConnection.prepareCall("{? = call proc (?, ?) }");
callStmt.registerOutParameter(1, java.sql.Types.INTEGER);
.....
callStmt.executeUpdate();
callStmt.getInt(1);
#2
在执行executeUpdate()报如下异常是什么原因
java.sql.SQLException: No row count was produced
java.sql.SQLException: No row count was produced
#1
try something like
CallableStatement callStmt;
callStmt = dbConnection.prepareCall("{? = call proc (?, ?) }");
callStmt.registerOutParameter(1, java.sql.Types.INTEGER);
.....
callStmt.executeUpdate();
callStmt.getInt(1);
CallableStatement callStmt;
callStmt = dbConnection.prepareCall("{? = call proc (?, ?) }");
callStmt.registerOutParameter(1, java.sql.Types.INTEGER);
.....
callStmt.executeUpdate();
callStmt.getInt(1);
#2
在执行executeUpdate()报如下异常是什么原因
java.sql.SQLException: No row count was produced
java.sql.SQLException: No row count was produced