在PL/SQL中调用Java方法
2012-05-17 16:12
465 查看
1. 通过创建Java source的方式将Java class编译到数据库中
2. 检查Java class是否编译成功
3. 创建PL/SQL测试程序包
4. 编写plsq测试脚本
此种方法可避免开发人员到服务器中编译java类并调用loadjava命令将java类载入系统中,所有的过程均在PLSQL客户端即可完成。
create or replace and compile java source named xxfnd as package xxfnd; public class Test{ public void Test(){ } pubic static String helloWorld(){ return "Hello, World!"; } }
2. 检查Java class是否编译成功
show errors java source xxfnd;
3. 创建PL/SQL测试程序包
create or replace package test_pkg is function hello_world return varchar2; end test_pkg; / create or replace package body test_pkg is function hello_world return varchar2 is language java name 'xxfnd.Test.helloWorld() return String'; end test_pkg; /
4. 编写plsq测试脚本
begin dbms_output.put_line(test_pkg.hello_world); end; /
此种方法可避免开发人员到服务器中编译java类并调用loadjava命令将java类载入系统中,所有的过程均在PLSQL客户端即可完成。
相关文章推荐
- 在PL/SQL中调用Java方法
- oracle pl/sql应用解析以及存储过程对应到java中的调用方法
- oracle pl/sql之在java中调用无参的oracle存储过程
- oracle pl/sql之在java中调用带有输入输出参数的oracle存储过程
- oracle PL/SQL调用Java生成Excel
- PL/SQL 调用JAVA 代码
- oracle pl/sql之在java中怎么调用oracle函数
- 在java中调用pl/sql编写的存储过程
- 在pl/sql中调用shell命令的4种方法
- oracle调用java方法的例子(下面所有代码都是在sql/plus中写)
- IT忍者神龟之Oracle PL/SQL 调用Java Source
- pl/sql 编写 Oracle分页的存储过程 Java调用该过程
- PL/SQL实现JAVA中的split()方法的小例子
- oracle调用java方法的例子(下面所有代码都是在sql/plus中写)
- PL/SQL 调用JAVA使用UDP发送数据
- PL/SQL调用JAVA获取网卡MAC地址
- oracle调用java方法的例子(下面所有代码都是在sql/plus中写)
- 使用pl/sql来调用java
- 存储过程的输出参数为游标,PL/SQL中如何调用 Java代码如何调用
- java调用sql方法