Oracle接口开发之PL/SQL Gateway

本文介绍了Oracle 10g Release 2中如何使用DBMS_EPG包创建和管理内嵌PL/SQL网关,通过示例展示了设置数据库访问描述符(DAD)、配置虚拟路径、权限管理和匿名访问等操作,为开发PL/SQL Web应用程序提供指导。
摘要由CSDN通过智能技术生成

DBMS_EPG - The Embedded PL/SQL Gateway in Oracle 10g Database Release 2

Since the introduction of XML DB in Oracle 9i Release 2, the Oracle server has contained an embedded HTTP server in addition to the Apache HTTP server. In Oracle 10g Release 2 this HTTP server can be used as an embedded PL/SQL gateway to run PL/SQL applications via mod_plsql. The administration of Database Access Descriptors (DADs) for the XML DB HTTP server is performed using the DBMS_EPG package. This article presents a simple example of its use.

First we must ensure that we have access to the SCOTT sample schema and the XDB schema.

CONN sys/password AS SYSDBA

-- Create SCOTT schema if you don't currently have it.
@$ORACLE_HOME/rdbms/admin/utlsampl.sql
ALTER USER scott IDENTIFIED BY tiger ACCOUNT UNLOCK;

Next we use the CREATE_DAD procedure to create a database access descriptor with an associated virtual path.

BEGIN
  DBMS_EPG.create_dad (
    dad_name => 'my_epg_dad',
    path     => '/my_epg_dad/*');
END;
/

The current mappings for a specific DAD can be retrieved using the get_all_dad_mappings procedure.

SET SERVEROUTPUT ON SIZE UNLIMITED
DECLARE
  l_paths  DBMS_EPG.varchar2_table;
BEGIN
  DBMS_EPG.get_all_dad_mappings (
    dad_name => 'my_epg_dad',
    paths    => l_paths);

  DBMS_OUTPUT.put_line('Mappings');
  DBMS_OUTPUT.put_line('========');
  FOR i IN 1 .. l_paths.count LOOP
    DBMS_OUTPUT.put_line(l_paths(i));
  END LOOP;
END;
/
Mappings
========
/my_epg_dad/*

PL/SQL procedure successfully completed.

SQL>

The mappings associated with existing DADs can be altered using the UNMAP_DAD and MAP_DAD procedures.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值