3
Mär

Configure the default page

When the DAD is created, it is possible to configure it with the set_dad_attribute procedure. In this example, we will specify the default page for the DAD.

BEGIN
DBMS_EPG.set_dad_attribute ('olvoyage', 'default-page', 'mon_package.home');
END;
/

'olvoyage' is the name of the DAD on which we'll add a new attribute of 'default-page' type.
We'll assign a value with the 'my_package.home' format which is the procedure called as the start page. This page is the result of the home procedure (from the my_package package) that you want to display as the home page.

To access the web application, type the following address in your web browser:
http://127.0.0.1:8080/olvoyage/

free b2evolution skin
3
Mär

Static Authentication

You can configure Static Authentication to avoid login demands while accessing your pages.

1. Grant the execution right on your package to lydy.

GRANT EXECUTE ON TEST TO lydy;

2. Use account with XDBADMIN role to set your DAD for lydy static authentication (you don’t need specify the password)

BEGIN
      dbms_epg.set_dad_attribute(dad_name => 'olvoyage',attr_name => 'database-username', attr_value => 'LYDY');
      END
      /

Warning: respect username case.

3. lydy must authorize the embedded gateway to use her privileges to invoke procedures and access document tables through the DAD. As lydy:

BEGIN
      dbms_epg.authorize_dad('LYDY');
      END;
      /
free b2evolution skin
3
Mär

Debugging Oracle Embedded PL/SQL Gateway

If your web page displays an error, you can see the errors with the activating error logging in Oracle XE Web server.

It allows you to trace PL/SQL errors when you develop a web application.

You must first activate the log option with a PL/SQL command.

SQL> execute dbms_epg.set_global_attribute('log-level', 3)

The different log-levels are:

0 - LOG_EMERG
1 - LOG_ALERT
2 - LOG_CRIT
3 - LOG_ERR
4 - LOG_WARNING
5 - LOG_NOTICE
6 - LOG_INFO
7 - LOG_DEBUG

After you can see the file:
/usr/lib/oracle/xe/app/oracle/admin/XE/bdump/xe_s00?_????.trc or C:\oraclexe\app\oracle\admin\XE\bdump\ xe_s00?_????.trc

To see the last error, you must open the most recent file with xe_s00 in its name.

free b2evolution skin
Free WordPress Themes