java 调用 Oracle包后 执行成功 但是要修改的东西没有变
Oracle package
CREATE OR REPLACE PACKAGE PKG_REPORT AS
FUNCTION GET_VALUE RETURN VARCHAR2;
PROCEDURE SET_VALUE(PS_TIME IN VARCHAR2);
END PKG_REPORT;
CREATE OR REPLACE PACKAGE BODY PKG_REPORT IS
M_V VARCHAR2(50);
PROCEDURE SET_VALUE(PS_TIME IN VARCHAR2) IS BEGIN M_V:=PS_TIME; END;
FUNCTION GET_VALUE RETURN VARCHAR2 IS BEGIN RETURN M_V; END;
END PKG_REPORT;
[code=Java][/code]
String sDBDriver="oracle.jdbc.driver.OracleDriver";
String sConnStr="jdbc:oracle:thin:@192.168.0.50:1521:dtcloud1";
Class.forName(sDBDriver);
Connection conn=DriverManager.getConnection(sConnStr,"dsm","dsm");
CallableStatement call=conn.prepareCall("{call pkg_report.SET_VALUE(?)}");
call.setString(1, "135546546545");
call.executeQuery();
这个执行成功了,但是M_V VARCHAR2 的值没改掉
求解~
------解决方案--------------------
修改时用的update()方法,executequery()只是查询不是修改