标签:logo callable void 没有 exce password man http manager
SQL> create or replace procedure sp_pro3(name_in varchar2,id_in varchar2) is 2 begin 3 update mytest set name=name_in where id=id_in; 4 end; 5 / Procedure created SQL> exec sp_pro3(‘newName‘,‘1‘) PL/SQL procedure successfully completed SQL> select * from mytest; NAME PASSWD ID ------------------------------ ------------------------------ -- newName 123456 1 李超 2222 2 小王 1222 3
在java代码中调用oracle的存储过程
public static void main(String[] args) { // TODO Auto-generated method stub try { //1.加载驱动 Class.forName("oracle.jdbc.driver.OracleDriver"); //2.得到连接 Connection ct=DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:ORCL","system","rqyz2618"); //3.创建CallableStatement CallableStatement cs=ct.prepareCall("{call sp_pro3(?,?)}"); //4.给?赋值 cs.setString(1, "gaodingle!!!!"); cs.setString(2, "2"); //5.执行 cs.execute(); //6.关闭 cs.close(); ct.close(); } catch (Exception e) { // TODO: handle exception e.printStackTrace(); }
标签:logo callable void 没有 exce password man http manager
原文地址:http://www.cnblogs.com/lingyejun/p/7095695.html