Tài liệu JPublisher User''''s Guide doc

202 374 0
Tài liệu JPublisher User''''s Guide doc

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Oracle® Database JPublisher User's Guide 10g Release 1 (10.1) Part No. B10983-01 December 2003 Oracle Database JPublisher User's Guide, 10g Release 1 (10.1) Part No. B10983-01 Copyright © 1999, 2003 Oracle. All rights reserved. Primary Author: Brian Wright Contributing Authors: Thomas Pfaeffle, P. Alan Thiesen, Janice Nygard, Ekkehard Rohwedder Contributors: Quan Wang, Prabha Krishna, Ellen Siegal The Programs (which include both the software and documentation) contain proprietary information; they are provided under a license agreement containing restrictions on use and disclosure and are also protected by copyright, patent, and other intellectual and industrial property laws. Reverse engineering, disassembly, or decompilation of the Programs, except to the extent required to obtain interoperability with other independently created software or as specified by law, is prohibited. The information contained in this document is subject to change without notice. If you find any problems in the documentation, please report them to us in writing. This document is not warranted to be error-free. Except as may be expressly permitted in your license agreement for these Programs, no part of these Programs may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose. If the Programs are delivered to the United States Government or anyone licensing or using the Programs on behalf of the United States Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are "commercial computer software" or "commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the Programs, including documentation and technical data, shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement, and, to the extent applicable, the additional rights set forth in FAR 52.227-19, Commercial Computer Software--Restricted Rights (June 1987). Oracle Corporation, 500 Oracle Parkway, Redwood City, CA 94065 The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently dangerous applications. It shall be the licensee's responsibility to take all appropriate fail-safe, backup, redundancy and other measures to ensure the safe use of such applications if the Programs are used for such purposes, and we disclaim liability for any damages caused by such use of the Programs. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. The Programs may provide links to Web sites and access to content, products, and services from third parties. Oracle is not responsible for the availability of, or any content provided on, third-party Web sites. You bear all risks associated with the use of such content. If you choose to purchase any products or services from a third party, the relationship is directly between you and the third party. Oracle is not responsible for: (a) the quality of third-party products or services; or (b) fulfilling any of the terms of the agreement with the third party, including delivery of products or services and warranty obligations related to purchased products or services. Oracle is not responsible for any loss or damage of any sort that you may incur from dealing with any third party. iii Contents Send Us Your Comments . vii Preface . ix Intended Audience ix Documentation Accessibility . x Structure . x Related Documents . xi Conventions . xiii 1 Introduction to JPublisher Overview of JPublisher . 1-1 JPublisher Initial Considerations . 1-2 New JPublisher Features in Oracle Database 10g 1-2 JPublisher Usage of the Oracle SQLJ Implementation . 1-4 JPublisher General Requirements 1-6 Required Packages and JAR Files in the Database 1-7 Situations for Reduced Requirements 1-10 JPublisher Limitations 1-10 What JPublisher Can Publish . 1-11 Publishing SQL User-Defined Types . 1-11 Publishing PL/SQL Packages . 1-14 Publishing Server-Side Java Classes . 1-16 Publishing SQL Queries or DML Statements 1-16 Publishing Proxy Classes and Wrappers for Web Services Call-Outs 1-17 JPublisher Mappings and Mapping Categories 1-17 JPublisher Mappings for User-Defined Types and PL/SQL Types 1-17 JPublisher Mapping Categories 1-20 JPublisher Input and Output 1-21 Input to JPublisher 1-21 Output from JPublisher 1-22 JPublisher Operation 1-24 Summary of the Publishing Process: Generation and Use of Output . 1-25 JPublisher Command-Line Syntax . 1-26 Sample JPublisher Translation 1-27 iv 2 Datatype and Java-to-Java Type Mappings JPublisher Datatype Mappings . 2-1 Overview of JPublisher Datatype Mappings . 2-1 SQL and PL/SQL Mappings to Oracle and JDBC Types . 2-2 JPublisher User Type Map and Default Type Map . 2-5 JPublisher Logical Progression for Datatype Mappings 2-6 Allowed Object Attribute Types 2-7 Mapping of REF CURSOR Types and Result Sets 2-7 Data Link Support and Mapping 2-10 Support for PL/SQL Datatypes . 2-10 Type Mapping Support for OPAQUE Types 2-11 Type Mapping Support for Scalar Indexed-by Tables Using JDBC OCI 2-13 Type Mapping Support Through PL/SQL Conversion Functions 2-15 Type Mapping Support for PL/SQL RECORD and Indexed-by Table Types . 2-17 Direct Use of PL/SQL Conversion Functions Versus Use of Wrapper Functions 2-20 Other Alternatives for Datatypes Unsupported by JDBC . 2-22 JPublisher Styles and Style Files 2-22 Style File Specification and Locations 2-22 Style File Formats 2-23 Summary of Key Java-to-Java Type Mappings in Oracle Style Files 2-26 Use of Multiple Style Files . 2-26 3 Generated Classes and Interfaces JPublisher Treatment of Output Parameters . 3-1 Passing Output Parameters in Arrays . 3-2 Passing Output Parameters in JAX-RPC Holders . 3-3 Passing Output Parameters in Function Returns 3-4 Translation of Overloaded Methods . 3-5 JPublisher Generation of SQLJ Classes . 3-7 Important Notes About Generation of SQLJ Classes 3-7 Use of SQLJ Classes That JPublisher Generates for PL/SQL Packages . 3-8 Use of SQLJ Classes That JPublisher Generates for Object Types . 3-8 More About Connection Contexts and Instances in SQLJ Classes . 3-9 The setFrom(), setValueFrom(), and setContextFrom() Methods 3-11 JPublisher Generation of Non-SQLJ Classes 3-11 JPublisher Generation of Java Interfaces . 3-13 JPublisher Subclasses . 3-14 Extending JPublisher-Generated Classes 3-14 JPublisher-Generated Subclasses for Java-to-Java Type Transformations . 3-16 JPublisher Support for Inheritance . 3-19 ORAData Object Types and Inheritance 3-19 ORAData Reference Types and Inheritance 3-21 SQLData Object Types and Inheritance . 3-25 Effects of Using SQL FINAL, NOT FINAL, NOT INSTANTIABLE 3-25 v 4 Additional Features and Considerations Summary of JPublisher Support for Web Services 4-1 Summary of Support for Web Services Call-Ins to the Database 4-1 Support for Web Services Call-Outs from the Database 4-2 Features to Filter JPublisher Output . 4-3 Publishing a Specified Subset of Functions or Procedures 4-3 Publishing Functions or Procedures According to Parameter Modes or Types . 4-3 Ensuring that Generated Methods Adhere to the JavaBeans Specification . 4-4 Backward Compatibility and Migration 4-4 JPublisher Backward Compatibility 4-4 Changes in JPublisher Behavior Between Oracle9i and Oracle Database 10g 4-5 Changes in JPublisher Behavior Between Oracle8i and Oracle9i . 4-5 JPublisher Backward Compatibility Modes and Settings 4-7 5 Command-Line Options and Input Files JPublisher Options . 5-1 JPublisher Option Summary . 5-1 JPublisher Option Tips 5-5 Notational Conventions 5-6 Options for Input Files and Items to Publish . 5-6 Connection Options 5-15 Options for Datatype Mappings . 5-17 Options for Type Maps 5-20 Java Code Generation Options 5-22 PL/SQL Code Generation Options 5-31 Input/Output Options . 5-32 Options to Facilitate Web Services Call-Outs . 5-34 Option to Access SQLJ Functionality . 5-42 Backward Compatibility Option . 5-43 Java Environment Options 5-45 Code Generation for Wrapper Class and PL/SQL Wrapper Options 5-46 Wrapper Class Generation without Handles 5-46 Wrapper Class Generation with Handles 5-47 Code Generation for Method Parameters 5-48 Code Generation for Table Functions 5-50 JPublisher Input Files . 5-51 Properties File Structure and Syntax 5-51 INPUT File Structure and Syntax . 5-53 INPUT File Precautions 5-57 A Generated Code Examples Generated Code: User Subclass for Java-to-Java Transformations A-1 Interface Code A-2 Base Class Code . A-2 User Subclass Code . A-4 Generated Code: SQL Statement A-7 vi Generated Code: Java and PL/SQL Wrappers for Web Services A-10 WSDL Document A-12 JAX-RPC Client Proxy Classes and Interfaces A-13 Java Wrapper Class and PL/SQL Wrapper A-18 Additional PL/SQL Utility Scripts . A-21 Generated Code: Java and PL/SQL Wrappers for General Use A-22 Classes to Be Wrapped . A-22 Java and PL/SQL Wrappers for Static Methods A-23 Java and PL/SQL Wrappers for Instance Methods Using the Handle Mechanism A-24 Index vii Send Us Your Comments Oracle Database JPublisher User's Guide, 10g Release 1 (10.1) Part No. B10983-01 Oracle welcomes your comments and suggestions on the quality and usefulness of this publication. Your input is an important part of the information used for revision. ■ Did you find any errors? ■ Is the information clearly presented? ■ Do you need more information? If so, where? ■ Are the examples correct? Do you need more examples? ■ What features did you like most about this manual? If you find any errors or have any other suggestions for improvement, please indicate the title and part number of the documentation and the chapter, section, and page number (if available). You can send comments to us in the following ways: ■ Electronic mail: jpgreader_us@oracle.com ■ FAX: (650) 506-7225. Attn: Java Platform Group, Information Development Manager ■ Postal service: Oracle Corporation Java Platform Group, Information Development Manager 500 Oracle Parkway, Mailstop 4op9 Redwood Shores, CA 94065 USA If you would like a reply, please give your name, address, telephone number, and electronic mail address (optional). If you have problems with the software, please contact your local Oracle Support Services. viii ix Preface This preface introduces you to the Oracle Database JPublisher User's Guide, discussing the intended audience, structure, and conventions of this document. A list of related Oracle documents is also provided. The JPublisher utility is for Java programmers who want classes in their applications to correspond to SQL or PL/SQL entities or server-side Java classes. In Oracle Database 10g, JPublisher also provides features supporting Web services call-ins to the database and call-outs from the database. This preface contains these topics: ■ Intended Audience ■ Documentation Accessibility ■ Structure ■ Related Documents ■ Conventions Intended Audience The Oracle Database JPublisher User's Guide is intended for JDBC and J2EE programmers who want to accomplish any of the following for database applications: ■ Create Java classes to map to SQL user-defined types, including object types, VARRAY types, and nested table types ■ Create Java classes to map to OPAQUE types ■ Create Java classes to map to PL/SQL packages ■ Create client-side Java stubs to call server-side Java classes ■ Publish SQL queries or DML statements as methods in Java classes ■ Create Java and PL/SQL wrappers for Web services client proxy classes, to enable call-outs to Web services from the database ■ Publish server-side SQL, PL/SQL or Java entities as Web services, to enable call-ins from outside the database To use this document, you need knowledge of Java, Oracle Database, SQL, PL/SQL, and JDBC. x Documentation Accessibility Our goal is to make Oracle products, services, and supporting documentation accessible, with good usability, to the disabled community. To that end, our documentation includes features that make information available to users of assistive technology. This documentation is available in HTML format, and contains markup to facilitate access by the disabled community. Standards will continue to evolve over time, and Oracle is actively engaged with other market-leading technology vendors to address technical obstacles so that our documentation can be accessible to all of our customers. For additional information, visit the Oracle Accessibility Program Web site at http://www.oracle.com/accessibility/ Accessibility of Code Examples in Documentation JAWS, a Windows screen reader, may not always correctly read the code examples in this document. The conventions for writing code require that closing braces should appear on an otherwise empty line; however, JAWS may not always read a line of text that consists solely of a bracket or brace. Accessibility of Links to External Web Sites in Documentation This documentation may contain links to Web sites of other companies or organizations that Oracle does not own or control. Oracle neither evaluates nor makes any representations regarding the accessibility of these Web sites. Structure This document contains: Chapter 1, "Introduction to JPublisher" Introduces the JPublisher utility by way of example, lists new features in this release, and provides an overview of JPublisher operations. Chapter 2, "Datatype and Java-to-Java Type Mappings" Provides details of JPublisher datatype mappings and the "styles" mechanism for Java-to-Java type mappings. Chapter 3, "Generated Classes and Interfaces" Discusses details and concepts of the classes, interfaces, and subclasses generated by JPublisher, including how output parameters (PL/SQL IN OUT or OUT parameters) are treated, how overloaded methods are translated, and how to use the generated classes and interfaces. Chapter 4, "Additional Features and Considerations" Covers additional JPublisher features and considerations: a summary of support for Web services; filtering of JPublisher output; and migration and backward compatibility. Chapter 5, "Command-Line Options and Input Files" Provides details of the JPublisher command-line syntax, command-line options and their usage, and input file format. [...]... to JPublisher This chapter provides an introduction and overview of the JPublisher utility, concluding with a summary of JPublisher operations and a sample translation It covers the following topics: ■ Overview of JPublisherJPublisher Initial Considerations ■ What JPublisher Can Publish ■ JPublisher Mappings and Mapping Categories ■ JPublisher Input and Output ■ JPublisher Operation Overview of JPublisher. .. the Oracle online documentation From the Oracle Application Server group: ■ Oracle Application Server 10g Administrator’s Guide ■ Oracle HTTP Server Administrator’s Guide ■ Oracle Application Server 10g Performance Guide ■ Oracle Application Server 10g Globalization Guide ■ Oracle Application Server Web Cache Administrator’s Guide ■ Oracle Application Server Web Services Developer’s Guide ■ Oracle Application... services See "Summary of JPublisher Support for Web Services" on page 4-1 for an overview of these features JPublisher Initial Considerations The following sections provide an overview of JPublisher new features and requirements, and how JPublisher uses SQLJ in its code generation: ■ New JPublisher Features in Oracle Database 10g ■ JPublisher Usage of the Oracle SQLJ Implementation ■ JPublisher General Requirements... in the Database ■ JPublisher Limitations New JPublisher Features in Oracle Database 10g Key new JPublisher features in Oracle Database 10g can be categorized as follows: ■ ■ Awareness of Java Environment Classpath ■ 1-2 New Features for Web Services New Features for Usage of SQLJ Oracle Database JPublisher User's Guide JPublisher Initial Considerations New Features for Web Services JPublisher is used... for J2EE Enterprise JavaBeans Developer’s Guide From the Oracle Server Technologies group: ■ Oracle XML DB Developer's Guide ■ Oracle XML Developer's Kit Programmer's Guide ■ Oracle XML Reference ■ Oracle Database Application Developer's Guide - Fundamentals ■ Oracle Database Application Developer's Guide - Large Objects ■ Oracle Database Application Developer's Guide - Object-Relational Features ■ PL/SQL... Packages and Types Reference ■ PL/SQL User's Guide and Reference xi ■ Oracle Database SQL Reference ■ Oracle Net Services Administrator's Guide ■ Oracle Advanced Security Administrator's Guide ■ Oracle Database Globalization Support Guide ■ Oracle Database Reference Note: Oracle error message documentation is available in HTML only If you have access to the Oracle Documentation CD only, you can browse the... Facilitate Web Services Call-Outs" on page 5-34 for details JPublisher Mappings and Mapping Categories The following sections offer a basic overview of JPublisher mappings and mapping categories: ■ JPublisher Mappings for User-Defined Types and PL/SQL Types ■ JPublisher Mapping Categories JPublisher Mappings for User-Defined Types and PL/SQL Types JPublisher provides mappings from the following to Java... statement, while several JDBC statements may be required for the same operation Because JPublisher generates code that uses SQLJ features, this document discusses some SQLJ concepts This section briefly defines some key concepts, for those not already familiar with SQLJ 1-4 Oracle Database JPublisher User's Guide JPublisher Initial Considerations ■ Connection contexts: A SQLJ connection context object... the code that JPublisher generates If your only goal is to work directly with sqlj files, then use the sqlj setting For more information, see "Backward Compatibility and Migration" on page 4-4 and "Backward Compatibility Option" on page 5-43 Introduction to JPublisher 1-5 JPublisher Initial Considerations JPublisher General Requirements This section describes the base requirements for JPublisher, then... Developer's Guide and Reference for more information about the JDBC files Each JDBC library also includes the JPublisher runtime classes in the oracle.jpub.runtime package ■ Web services classes These classes are included in the library utl_dbws.jar, typically located in ORACLE_HOME/sqlj/lib ■ 1-6 Additional PL/SQL packages and JAR files in the database, as needed Oracle Database JPublisher User's Guide JPublisher . JPublisher Can Publish ■ JPublisher Mappings and Mapping Categories ■ JPublisher Input and Output ■ JPublisher Operation Overview of JPublisher JPublisher is a. Database JPublisher User's Guide, discussing the intended audience, structure, and conventions of this document. A list of related Oracle documents

Ngày đăng: 21/12/2013, 04:16

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan