jpa 调用oracle 存储过程 无返回值 ,有返回值。

来源:互联网 发布:为什么移动数据连不上 编辑:程序博客网 时间:2024/05/07 22:35

数据库建表就不说了 test表 三个字段 id name text  都是varchar2()


首先是个插入储存过程:

create or replace procedure addTest is
begin
insert into test (id ,name,text) values ('33','eee','eee');
end addTest;
drop procedure addTest;


@In
    EntityManager entityManager;
    
    public void addTest(){
        entityManager.createNativeQuery("{call addTest()}").executeUpdate();
        
    }


OK 就这么简单。



有返回值的 还未解决 不知道为什么带out参数的存储过程总是报错。。。。希望高手指点