01.02.2013 Views

Publishing Reports to the Web - Downloads - Oracle

Publishing Reports to the Web - Downloads - Oracle

Publishing Reports to the Web - Downloads - Oracle

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Methodology<br />

20.1.2 Accessing <strong>the</strong> Data<br />

procedure for operations that cannot be performed using normal SQL (for example, <strong>to</strong><br />

create a temporary table or any o<strong>the</strong>r form of DDL), and in places where it will be<br />

executed sparingly (for example, in triggers that are only fired once per report).<br />

The primary reason <strong>to</strong> use <strong>the</strong> SRW.DO_SQL() built-in procedure is <strong>to</strong> perform DDL<br />

operations, such as creating or dropping temporary tables. For example, have <strong>the</strong><br />

SRW.DO_SQL() built-in procedure <strong>to</strong> create a table. The table’s name is determined by<br />

a parameter entered in <strong>the</strong> Runtime Parameter Form.<br />

Example<br />

SRW.DO_SQL (`CREATE TABLE' || :tname ||<br />

`(ACCOUNT NUMBER<br />

NOT NULL PRIMARY KEY, COMP NUMBER (10,2))');<br />

20.1.1.4 Java S<strong>to</strong>red Procedures<br />

Java s<strong>to</strong>red procedures enable you <strong>to</strong> implement business logic at <strong>the</strong> server level;<br />

<strong>the</strong>reby, improving application performance, scalability, and security. <strong>Oracle</strong>9i allows<br />

PL/SQL and Java s<strong>to</strong>red procedures <strong>to</strong> be s<strong>to</strong>red in <strong>the</strong> database. Typically, SQL<br />

programmers who want procedural extensions favor PL/SQL and Java programmers<br />

who want easy access <strong>to</strong> <strong>Oracle</strong> data favor Java. Although Java s<strong>to</strong>red procedures offer<br />

extra flexibility, <strong>the</strong>re is some overhead involved. Balance <strong>the</strong> trade off between<br />

performance and flexibility based on your individual needs.<br />

Refer <strong>to</strong> <strong>the</strong> <strong>Oracle</strong>9i Java S<strong>to</strong>red Procedures Developer's Guide for more information on<br />

Java s<strong>to</strong>red procedures.<br />

20.1.1.5 The Java Importer<br />

Although <strong>Oracle</strong> PL/SQL provides a powerful and productive development<br />

environment, it is sometimes necessary <strong>to</strong> integrate with external application services<br />

and providers. As many of <strong>the</strong>se external application services and providers are<br />

increasingly offering integration points in Java. <strong>Oracle</strong> <strong>Reports</strong> integrates with <strong>the</strong><br />

<strong>Oracle</strong> Java Importer <strong>to</strong> facilitate <strong>the</strong> invocation of business logic contained in external<br />

middle-tier Java classes. The Java Importer declaratively creates a PL/SQL wrapper<br />

package for each class you select and exposes <strong>the</strong> methods identified in <strong>the</strong> class<br />

through PL/SQL functions and procedures. This allows you <strong>to</strong> instantiate, use, and<br />

destroy <strong>the</strong> Java object instances when <strong>the</strong> report is run. While this powerful extension<br />

insulates you from having <strong>to</strong> write Java code yourself, <strong>the</strong>re is some overhead<br />

involved. Separate PL/SQL packages are generated for every class specified. The<br />

PL/SQL genera<strong>to</strong>r performs type translations when it generates <strong>the</strong> PL/SQL packages<br />

from <strong>the</strong> Java methods. Any time a Java object instance is created using <strong>the</strong> new<br />

function in <strong>the</strong> PL/SQL package and generated by <strong>the</strong> Java Importer, <strong>the</strong> result is<br />

s<strong>to</strong>red in a variable of type JOBJECT. Java Object persistence must be carefully handled<br />

because accumulating large numbers of global references without removing <strong>the</strong>m<br />

increases <strong>the</strong> JVM’s memory consumption.<br />

If your performance measuring <strong>to</strong>ols show that <strong>the</strong> report spends a large amount of<br />

time accessing data from <strong>the</strong> data source(s), you need <strong>to</strong> review <strong>the</strong> structure of <strong>the</strong><br />

data and determine how <strong>the</strong> data is being used. Inefficient schema design has a<br />

dramatic affect on <strong>the</strong> performance of a report. For example, an overly normalized<br />

data model can result in many avoidable joins or queries.<br />

20-8 <strong>Oracle</strong> Application Server <strong>Reports</strong> Services <strong>Publishing</strong> <strong>Reports</strong> <strong>to</strong> <strong>the</strong> <strong>Web</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!