我想使用Java代码执行PL / SQL过程。到目前为止,我已经尝试过了:
Statement myStmt = null;
myStmt = conn.createStatement();
myStmt.executeQuery("EXECUTE ProjetIRSTEA.detectionX");
而且我收到以下错误消息:
java.sql.SQLSyntaxErrorException: ORA-00900: invalid SQL statement
尝试:
myStmt.executeUpdate("BEGIN ProjetIRSTEA.detectionX; END");
您还可以通过CallableStatement接口使用一种方法来调用JDBC标准定义的存储过程:
CallableStatement myCall = connection.prepareCall("{call ProjetIRSTEA.detectionX()}")
myCall.executeUpdate();
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句