Skip Headers

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

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

Go to next page
View PDF


Title and Copyright Information

Send Us Your Comments


Documentation Accessibility
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 Classes Attributes 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 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 JDBC Drivers 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 Compiling Source Through javac Compiling Source Through loadjava Compiling Source at Runtime Specifying Compiler Options Automatic Recompilation
2.5.2 Resolving Class Dependencies Allowing References to Non-Existent Classes ByteCode Verifier
2.5.3 Loading Classes Defining the Same Class Twice Designating Database Privileges and JVM Permissions 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 Object Name and Type 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 Operating System Resource Access 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 Oracle-Specific Support for End-of-Call Optimization
2.11.2 Operating System Resources Affected Across Calls Files Sockets 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 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 JAR Files Necessary for Java 2 Clients 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 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 Map and Order Methods Constructor Methods Using Class oracle.sql.STRUCT Implementing the SQLData Interface 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 Fine-Grain Definition for Each Permission Acquiring Administrative Permission to Update Policy Table Creating Permissions Enabling or Disabling Permissions Permission Types Initial Permission Grants 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 Installation Requirements
10.1.4 Executing Accelerator
10.1.5 ncomp Syntax Argument Summary Argument Details Errors
10.1.6 Native Compilation Usage Scenarios Natively Compiling on Test Platform—Java Classes Already Loaded in the Database Natively Compiling Java Classes Not Loaded in the Database Clean Compile and Generate Output for Future Deployment Controlling Native Compilation Build Environment Natively Compiling Specific Classes Natively Compiling Packages That Are Fully or Partially Modified
10.1.7 deploync Syntax Argument Summary
10.1.8 statusnc Syntax Argument Summary
10.2 Java Memory Usage
10.2.1 Configuring Memory Initialization Parameters 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 Example
11.8.3 ojvmjava Options ojvmjava Tool Output Redirection Scripting ojvmjava Commands in the @<filename> Option
11.8.4 Shell Commands echo exit Command help Command java Command version Command 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