首页 > 编程知识 正文

oracle存储过程授权,set的数据结构

时间:2023-05-05 17:59:28 阅读:115193 作者:1928

创建hello world存储过程

文件-新建-程序窗口-产品

单击确定以创建代码

createorreplaceprocedurep _ hello is

-在此定义变量

比根

DBMS _ output.put _ line (' hello world!' );

endp_hello;

测试存储过程,创建新的测试窗口,然后调用存储过程。

2 .存储过程

输入、输出类型

自定义参数类型

引用表字段的参数类型

过程函数的调用

看结果:

使用java调用oracle存储过程

@Test

publicvoidcallprocedure throws exception { }

long start=system.current time millis (;

//设置驱动器

class.forname (驱动程序;

//创建链接

connection conn=driver manager.getconnection (dburl,name,password );

//关闭自动提交

conn.set自动提交(false );

callablestatementcst=conn.prepare call (' { callp _ use table )? () );

CST.setstring(1,'撒娇香菇');

CST.set int (2,13 );

//登录输出参数

CST.registeroutparameter(3,Types.VARCHAR );

cst.execute (;

system.out.println (CST.getstring (3) );

conn.commit (;

conn.close (;

system.out.println (system.current time millis (-start );

}

输出结果:

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。