Skip Headers

Oracle® Database Java Developer's Guide
10g Release 1 (10.1)

Part Number B12021-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to next page
Next
View PDF

Contents

Title and Copyright Information

Send Us Your Comments

Preface

Audience
Documentation Accessibility
Organization
Java API Programming Models
Suggested Reading
Online Sources

1 Introduction to Java in Oracle Database

1.1 Chapter Contents
1.2 What's New in this Release?
1.2.1 Upgrading to J2SE 1.4.1
1.2.2 New Memory Model for Dedicated Mode Sessions
1.2.3 Database Web Services Callouts
1.2.4 Native Java Interface
1.2.5 EJB Call-out
1.3 Overview of Java
1.3.1 Java and Object-Oriented Programming Terminology
1.3.1.1 Classes
1.3.1.2 Attributes
1.3.1.3 Methods
1.3.2 Class Hierarchy
1.3.3 Interfaces
1.3.4 Polymorphism
1.3.5 The Java Virtual Machine (JVM)
1.3.6 Key Features of the Java Language
1.4 Why Use Java in Oracle Database?
1.5 Java and the RDBMS: A Robust Combination
1.5.1 Multithreading
1.5.2 Automated Storage Management With Garbage Collection
1.5.3 Footprint
1.5.4 Performance
1.5.4.1 How Native Compilers Improve Performance
1.5.5 Dynamic Class Loading
1.6 What is Different With OracleJVM?
1.6.1 Method main()
1.6.2 The GUI
1.6.3 The IDE
1.7 Main Components of the OracleJVM
1.7.1 Library Manager
1.7.2 Compiler
1.7.3 Interpreter
1.7.4 Class Loader
1.7.5 Verifier
1.7.6 Server-Side JDBC Internal Driver
1.8 Oracle's Java Application Strategy
1.8.1 Java Programming Environment
1.8.2 Java Stored Procedures
1.8.3 PL/SQL Integration and Oracle RDBMS Functionality
1.8.3.1 JDBC Drivers
1.8.3.2 JPublisher
1.8.4 Development Tools
1.9 Desupport of J2EE Technologies in the Oracle Database

2 Java Applications on Oracle Database

2.1 Overview
2.2 Database Sessions Imposed on Java Applications
2.2.1 Java Supported APIs
2.3 Execution Control
2.4 Java Code, Binaries, and Resources Storage
2.4.1 Java Classes Loaded in the Database
2.5 Preparing Java Class Methods for Execution
2.5.1 Compiling Java Classes
2.5.1.1 Compiling Source Through javac
2.5.1.2 Compiling Source Through loadjava
2.5.1.3 Compiling Source at Runtime
2.5.1.4 Specifying Compiler Options
2.5.1.5 Automatic Recompilation
2.5.2 Resolving Class Dependencies
2.5.2.1 Allowing References to Non-Existent Classes
2.5.2.2 ByteCode Verifier
2.5.3 Loading Classes
2.5.3.1 Defining the Same Class Twice
2.5.3.2 Designating Database Privileges and JVM Permissions
2.5.3.3 Loading JAR or ZIP Files
2.5.4 How to Grant Execute Rights
2.5.5 Controlling the Current User
2.5.6 Checking Java Uploads
2.5.6.1 Object Name and Type
2.5.6.2 Status
2.5.7 Publishing
2.6 User Interfaces on the Server
2.7 Shortened Class Names
2.8 Class.forName() in Oracle Database
2.8.1 Supply the ClassLoader in Class.forName
2.8.2 Supply Class and Schema Names to classForNameAndSchema
2.8.3 Supply Class and Schema Names to lookupClass
2.8.4 Supply Class and Schema Names when Serializing
2.8.5 Class.forName Example
2.9 Managing Your Operating System Resources
2.9.1 Overview of Operating System Resources
2.9.1.1 Operating System Resource Access
2.9.1.2 Operating System Resource Lifetime
2.9.2 Garbage Collection and Operating System Resources
2.10 Threading in Oracle Database
2.10.1 Thread Life Cycle
2.11 Special Considerations for Shared Servers
2.11.1 End-of-Call Migration
2.11.1.1 Oracle-Specific Support for End-of-Call Optimization
2.11.2 Operating System Resources Affected Across Calls
2.11.2.1 Files
2.11.2.2 Sockets
2.11.2.3 Threads

3 Invoking Java in the Database

3.1 Overview
3.2 Invoking Java Methods
3.2.1 Utilizing Java Stored Procedures
3.2.2 Utilizing Java Native Interface (JNI) Support
3.2.3 Utilizing SQLJ and JDBC for Querying the Database
3.2.3.1 JDBC
3.2.4 An Example Comparing JDBC and SQLJ
3.3 Debugging Server Applications
3.4 How To Tell You Are Executing in the Server
3.5 Redirecting Output on the Server
3.6 Support for Calling Java Stored Procedures Directly

4 Java Installation and Configuration

4.1 Initializing a Java-Enabled Database
4.1.1 Oracle Database Template Configuration and Install
4.1.2 Modifying an Existing Oracle Database to Include OracleJVM
4.2 Configuring OracleJVM
4.3 Using The DBMS_JAVA Package
4.4 Enabling the Java Client
4.4.1 1. Install J2SE on the Client
4.4.2 2. Set up Environment Variables
4.4.2.1 JAR Files Necessary for Java 2 Clients
4.4.2.2 Server Application Development on the Client
4.4.3 3. Test Install with Samples

5 Developing Java Stored Procedures

5.1 Stored Procedures and Run-Time Contexts
5.1.1 Functions and Procedures
5.1.2 Database Triggers
5.1.3 Object-Relational Methods
5.2 Advantages of Stored Procedures
5.2.1 Performance
5.2.2 Productivity and Ease of Use
5.2.3 Scalability
5.2.4 Maintainability
5.2.5 Interoperability
5.2.6 Replication
5.2.7 Security
5.3 Java Stored Procedure Configuration
5.4 Java Stored Procedures Steps

6 Publishing Java Classes With Call Specs

6.1 Understanding Call Specs
6.2 Defining Call Specs: Basic Requirements
6.2.1 Setting Parameter Modes
6.2.2 Mapping Datatypes
6.2.3 Using the Server-Side Internal JDBC Driver
6.2.3.1 Important Points
6.3 Writing Top-Level Call Specs
6.4 Writing Packaged Call Specs
6.5 Writing Object Type Call Specs
6.5.1 Declaring Attributes
6.5.2 Declaring Methods
6.5.2.1 Map and Order Methods
6.5.2.2 Constructor Methods
6.5.2.3 Using Class oracle.sql.STRUCT
6.5.2.4 Implementing the SQLData Interface
6.5.2.5 Implementing Object Type Methods

7 Calling Stored Procedures

7.1 Calling Java from the Top Level
7.1.1 Redirecting Output
7.2 Calling Java from Database Triggers
7.3 Calling Java from SQL DML
7.3.1 Restrictions
7.4 Calling Java from PL/SQL
7.5 Calling PL/SQL from Java
7.6 How OracleJVM Handles Exceptions

8 Java Stored Procedures Application Example

8.1 Drawing the Entity-Relationship Diagram
8.2 Planning the Database Schema
8.3 Creating the Database Tables
8.4 Writing the Java Classes
8.5 Loading the Java Classes
8.6 Publishing the Java Classes
8.7 Calling the Java Stored Procedures

9 Security For Oracle Database Java Applications

9.1 Network Connection Security
9.2 Database Contents and OracleJVM Security
9.2.1 Java 2 Security
9.2.2 Setting Permissions
9.2.2.1 Fine-Grain Definition for Each Permission
9.2.2.2 Acquiring Administrative Permission to Update Policy Table
9.2.2.3 Creating Permissions
9.2.2.4 Enabling or Disabling Permissions
9.2.2.5 Permission Types
9.2.2.6 Initial Permission Grants
9.2.2.7 General Permission Definition Assigned to Roles
9.2.3 Debugging Permissions
9.2.4 Permission for Loading Classes
9.3 Database Authentication Mechanisms

10 Oracle Database Java Application Performance

10.1 Natively Compiled Code
10.1.1 Accelerator Overview
10.1.2 Oracle Database Core Java Class Libraries
10.1.3 Natively Compiling Java Application Class Libraries
10.1.3.1 Installation Requirements
10.1.4 Executing Accelerator
10.1.5 ncomp
10.1.5.1 Syntax
10.1.5.2 Argument Summary
10.1.5.3 Argument Details
10.1.5.4 Errors
10.1.6 Native Compilation Usage Scenarios
10.1.6.1 Natively Compiling on Test Platform—Java Classes Already Loaded in the Database
10.1.6.2 Natively Compiling Java Classes Not Loaded in the Database
10.1.6.3 Clean Compile and Generate Output for Future Deployment
10.1.6.4 Controlling Native Compilation Build Environment
10.1.6.5 Natively Compiling Specific Classes
10.1.6.6 Natively Compiling Packages That Are Fully or Partially Modified
10.1.7 deploync
10.1.7.1 Syntax
10.1.7.2 Argument Summary
10.1.8 statusnc
10.1.8.1 Syntax
10.1.8.2 Argument Summary
10.2 Java Memory Usage
10.2.1 Configuring Memory Initialization Parameters
10.2.1.1 Initializing Pool Sizes within Database Templates
10.2.2 Java Pool Memory
10.2.3 Displaying Used Amounts of Java Pool Memory
10.2.4 Correcting Out of Memory Errors

11 Schema Object Tools

11.1 Schema Object Tool Overview
11.2 What and When to Load
11.3 Resolution
11.4 Digest Table
11.5 Compilation
11.6 loadjava
11.6.1 Syntax
11.6.2 Argument Summary
11.6.3 Argument Details
11.7 dropjava
11.7.1 Syntax
11.7.2 Argument Summary
11.7.3 Argument Details
11.7.4 Dropping Resources
11.8 ojvmjava
11.8.1 Syntax
11.8.2 Argument Summary
11.8.2.1 Example
11.8.3 ojvmjava Options
11.8.3.1 ojvmjava Tool Output Redirection
11.8.3.2 Scripting ojvmjava Commands in the @<filename> Option
11.8.4 Shell Commands
11.8.4.1 echo
11.8.4.2 exit Command
11.8.4.3 help Command
11.8.4.4 java Command
11.8.4.5 version Command
11.8.4.6 whoami

12 Database Web Services

12.1 Database Web Services
12.2 Using the Database as Service Provider for Web Services
12.2.1 JPublisher Support for Web Services Call-Ins to the Database
12.3 Using the Database as Service Consumer for Web Services
12.3.1 Installation Requirements
12.3.2 JPublisher Generation Overview
12.3.3 Adjusting the Mapping of SQL Types
12.4 Using the Native Java Interface

A DBMS_JAVA Package

Glossary

Index