没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Oracle8
i
SQLJ Developer’s Guide and Reference
Release 3 (8.1.7)
July 2000
Part No. A83723-01
SQLJ Developer’s Guide and Reference, Release 3 (8.1.7)
Part No. A83723-01
Copyright © 1996, 1999, 2000 Oracle Corporation. All rights reserved.
Primary Author: Brian Wright
Contributing Author: Ekkehard Rohwedder
Contributors: Brian Becker, Alan Thiesen, Lei Tang, Julie Basu, Pierre Dufour, Jerry Schwarz, Risto
Lankinen, Cheuk Chau, Vishu Krishnamurthy, Rafiul Ahad, Jack Melnick, Tim Smith, Thomas Pfaeffle,
Tom Portfolio, Ellen Barnes, Susan Kraft, Sheryl Maring, Angie Long
The Programs (which include both the software and documentation) contain proprietary information of
Oracle Corporation; 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 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. Oracle Corporation does not warrant that this
document is 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, without the express written permission of Oracle Corporation.
If the Programs are delivered to the U.S. Government or anyone licensing or using the programs on
behalf of the U.S. Government, the following notice is applicable:
Restricted Rights Notice Programs delivered subject to the DOD FAR Supplement are "commercial
computer software" and use, duplication, and disclosure of the Programs, including documentation,
shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement.
Otherwise, Programs delivered subject to the Federal Acquisition Regulations are "restricted computer
software" and use, duplication, and disclosure of the Programs shall be subject to the restrictions 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 Oracle Corporation disclaims liability for any damages caused by such use of the
Programs.
Oracle is a registered trademark, and JDeveloper ™, Net8 ™, Oracle Objects ™, Oracle8 i™, Oracle8 ™,
Oracle7 ™, Oracle Lite ™, PL/SQL ™, Pro*C ™, SQL*Net®, and SQL*Plus® are trademarks or registered
trademarks of Oracle Corporation. All other company or product names mentioned are used for
identification purposes only and may be trademarks of their respective owners.
iii
Contents
Send Us Your Comments .................................................................................................................. xv
Preface......................................................................................................................................................... xvii
Intended Audience ............................................................................................................................. xvii
Document Structure ........................................................................................................................... xviii
Document Conventions ....................................................................................................................... xx
Related Documents.............................................................................................................................. xxi
1 Overview
Introduction to SQLJ.......................................................................................................................... 1-2
Basic Concepts............................................................................................................................... 1-2
Java and SQLJ versus PL/SQL ................................................................................................... 1-3
Overview of SQLJ Components ...................................................................................................... 1-5
SQLJ Translator and SQLJ Runtime........................................................................................... 1-5
SQLJ Profiles.................................................................................................................................. 1-6
Overview of Oracle Extensions to the SQLJ Standard................................................................ 1-8
Basic Translation Steps and Runtime Processing......................................................................... 1-9
Translation Steps .......................................................................................................................... 1-9
Summary of Translator Input and Output ............................................................................. 1-11
Runtime Processing.................................................................................................................... 1-14
Alternative Deployment Scenarios............................................................................................... 1-16
Running SQLJ in Applets .......................................................................................................... 1-16
Introduction to SQLJ in the Server........................................................................................... 1-19
Using SQLJ with an Oracle Lite Database .............................................................................. 1-20
iv
Alternative Development Scenarios ............................................................................................. 1-23
SQLJ NLS Support...................................................................................................................... 1-23
SQLJ in JDeveloper and Other IDEs ........................................................................................ 1-23
Windows Considerations .......................................................................................................... 1-24
2 Getting Started
Assumptions and Requirements...................................................................................................... 2-2
Assumptions About Your Environment ................................................................................... 2-2
Requirements for Using Oracle SQLJ ........................................................................................ 2-2
Supported JDK Versions.............................................................................................................. 2-4
JServer Configuration................................................................................................................... 2-4
Checking the Installation and Configuration ............................................................................... 2-6
Check for Installed Directories and Files .................................................................................. 2-6
Set the PATH and CLASSPATH ................................................................................................ 2-6
Verify Installation of sqljutl Package ......................................................................................... 2-8
Testing the Setup................................................................................................................................. 2-9
Set Up the Runtime Connection ................................................................................................. 2-9
Create a Table to Verify the Database...................................................................................... 2-10
Verify the JDBC Driver .............................................................................................................. 2-11
Verify the SQLJ Translator and Runtime ................................................................................ 2-11
Verify the SQLJ Translator Connection to the Database....................................................... 2-12
3 Basic Language Features
Overview of SQLJ Declarations....................................................................................................... 3-2
Rules for SQLJ Declarations........................................................................................................ 3-2
Iterator Declarations..................................................................................................................... 3-3
Connection Context Declarations............................................................................................... 3-4
Declaration IMPLEMENTS Clause ............................................................................................ 3-5
Declaration WITH Clause............................................................................................................ 3-6
Overview of SQLJ Executable Statements..................................................................................... 3-9
Rules for SQLJ Executable Statements....................................................................................... 3-9
SQLJ Clauses.................................................................................................................................. 3-9
Specifying Connection Context Instances and Execution Context Instances .................... 3-11
Executable Statement Examples ............................................................................................... 3-12
PL/SQL Blocks in Executable Statements............................................................................... 3-13
v
Java Host Expressions, Context Expressions, and Result Expressions................................... 3-15
Overview of Host Expressions ................................................................................................. 3-15
Basic Host Expression Syntax................................................................................................... 3-16
Examples of Host Expressions.................................................................................................. 3-18
Overview of Result Expressions and Context Expressions.................................................. 3-20
Evaluation of Java Expressions at Runtime............................................................................ 3-20
Examples of Evaluation of Java Expressions at Runtime ..................................................... 3-22
Restrictions on Host Expressions ............................................................................................. 3-31
Single-Row Query Results—SELECT INTO Statements ......................................................... 3-32
Examples of SELECT INTO Statements.................................................................................. 3-33
Examples with Host Expressions in SELECT-List................................................................. 3-33
Multi-Row Query Results—SQLJ Iterators................................................................................. 3-35
Iterator Concepts ........................................................................................................................ 3-35
General Steps in Using an Iterator ........................................................................................... 3-38
Named Iterators versus Positional Iterators........................................................................... 3-39
Using Named Iterators .............................................................................................................. 3-40
Using Positional Iterators.......................................................................................................... 3-44
Using Iterators and Result Sets as Host Variables................................................................. 3-48
Using Iterators and Result Sets as Iterator Columns............................................................. 3-52
Assignment Statements (SET)........................................................................................................ 3-55
Stored Procedure and Function Calls ........................................................................................... 3-57
Calling Stored Procedures......................................................................................................... 3-57
Calling Stored Functions ........................................................................................................... 3-58
Using Iterators and Result Sets as Stored Function Returns................................................ 3-60
4 Key Programming Considerations
Naming Requirements and Restrictions........................................................................................ 4-2
Java Namespace—Local Variable and Class Naming Restrictions....................................... 4-2
SQLJ Namespace .......................................................................................................................... 4-3
SQL Namespace............................................................................................................................ 4-4
File Name Requirements and Restrictions................................................................................ 4-4
Selection of the JDBC Driver ........................................................................................................... 4-5
Overview of the Oracle JDBC Drivers....................................................................................... 4-5
Driver Selection for Translation ................................................................................................. 4-6
Driver Selection and Registration for Runtime........................................................................ 4-7
剩余679页未读,继续阅读
资源评论
fokyingkit
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功