表结构跟” Oralce存储过程的创建和调用“文中用到的wawa表相同。
创建package
create or replace package pk_scott_wawa
as
procedure spStr(str out clob);
procedure spString(str out clob);
end pk_scott_wawa;
创建package body
create or replace package body pk_scott_wawa
as
procedure spStr(str out clob)
is
begin
select userName into str from wawa where ID=3;
end;
procedure spString(str out clob)
is
begin
select userName into str from wawa where ID=3;
end;
end pk_scott_wawa;
调用package里的存储过程
String sql = "{call pk_scott_wawa.spStr(?)}";
// String sql = "{call pk_scott_wawa.spString(?)}";