Skip Headers
Oracle® Database Java Developer's Guide,
11g Release 1 (11.1)
Part Number B31225-01
Home
Book List
Index
Master Index
Contact Us
Next
View PDF
Contents
List of Examples
List of Figures
List of Tables
Title and Copyright Information
Preface
Audience
Documentation Accessibility
Related Documents
Conventions
What's New in 11
g
Release 1 (11.1)
Oracle JVM Compatibility with JDK 1.5
Oracle JVM Utilities Enhancements
Ease-of-Use Interface
Oracle JVM Just-in-Time Compiler (JIT)
1
Introduction to Java in Oracle Database
Overview of Java
Java and Object-Oriented Programming Terminology
Classes
Objects
Interfaces
Encapsulation
Inheritance
Polymorphism
Key Features of the Java Language
JVM
Java Class Hierarchy
Using Java in Oracle Database
Java and RDBMS: A Robust Combination
Multithreading
Automated Storage Management With Garbage Collection
Footprint
Performance of Oracle JVM
Dynamic Class Loading
Overview of Oracle JVM
Process Area
The main() Method
The GUI
The IDE
Main Components of Oracle JVM
Library Manager
Compiler
Interpreter
Class Loader
Verifier
Server-Side JDBC Internal Driver
Server-Side SQLJ Translator
System Classes
Java Application Strategy of Oracle
Java in Database Application Development
Java Programming Environment
Java Stored Procedures
PL/SQL Integration and Oracle RDBMS Functionality
JDBC Drivers
SQLJ
JPublisher
Development Tools
Memory Model for Dedicated Mode Sessions
2
Java Applications on Oracle Database
Database Sessions Imposed on Java Applications
Execution Control of Java Applications
Java Code, Binaries, and Resources Storage
Preparing Java Class Methods for Execution
Compiling Java Classes
Compiling Source Through javac
Compiling Source Through loadjava
Compiling Source at Run Time
Specifying Compiler Options
Recompiling Automatically
Resolving Class Dependencies
Loading Classes
Granting Execute Rights
Controlling the Current User
Checking Java Uploads
Publishing
Auditing
User Interfaces on the Server
Shortened Class Names
Class.forName() in Oracle Database
Supply ClassLoader in Class.forName()
Supply Class and Schema Names to classForNameAndSchema()
Supply Class and Schema Names to lookupClass()
Supply Class and Schema Names when Serializing
Class.forName Example
Managing Your Operating System Resources
Overview of Operating System Resources
Garbage Collection and Operating System Resources
Managing Your Applications Using JMX
Enabling and Starting JMX in a Session
OJVM JMX Defaults and Configurability
Examples of SQL calls to dbms_java.start_jmx_agent
Important Security Notes
Threading in Oracle Database
Shared Servers Considerations
End-of-Call Migration
Oracle-Specific Support for End-of-Call Optimization
The EndOfCallRegistry.registerCallback() Method
The EndOfCallRegistry.runCallbacks() Method
The Callback Interface
The Callback.act() method
Operating System Resources Affected Across Calls
3
Calling Java Methods in Oracle Database
Invoking Java Methods
Using PL/SQL Wrappers
JNI Support
Utilizing SQLJ and JDBC with Java in the Database
JDBC
SQLJ
Example Comparing JDBC and SQLJ
Complete SQLJ Example
SQLJ Strong Typing Paradigm
Translating a SQLJ Program
Running a SQLJ Program in the Server
Converting a Client Application to Run on the Server
Interacting with PL/SQL
Using Command-Line Interface
Using the Client-Side Stub
Debugging Server Applications
How To Tell You Are Running on the Server
Redirecting Output on the Server
Calling Java in the Database Directly
4
Java Installation and Configuration
Initializing a Java-Enabled Database
Configuring with Oracle Database Template
Modifying an Existing Oracle Database to Include Oracle JVM
Configuring Oracle JVM
Using The DBMS_JAVA Package
Enabling the Java Client
Install J2SE on the Client
Set Up Environment Variables
Test Install with Samples
Two-Tier Duration for Java Session State
Setting System Properties
5
Developing Java Stored Procedures
Stored Procedures and Run-Time Contexts
Functions and Procedures
Database Triggers
Object-Relational Methods
Advantages of Stored Procedures
Performance
Productivity and Ease of Use
Scalability
Maintainability
Interoperability
Replication
Security
Java Stored Procedures Steps
Step 1: Create or Reuse the Java Classes
Step 2: Load and Resolve the Java Classes
Step 3: Publish the Java Classes
Step 4: Call the Stored Procedures
Step 5: Debug the Stored Procedures, if Necessary
6
Publishing Java Classes With Call Specifications
Understanding Call Specifications
Defining Call Specifications
Setting Parameter Modes
Mapping Data Types
Using the Server-Side Internal JDBC Driver
Writing Top-Level Call Specifications
Writing Packaged Call Specifications
Writing Object Type Call Specifications
Declaring Attributes
Declaring Methods
Map and Order Methods
Constructor Methods
Examples
7
Calling Stored Procedures
Calling Java from the Top Level
Redirecting Output
Examples of Calling Java Stored Procedures From the Top Level
Calling Java from Database Triggers
Calling Java from SQL DML
Calling Java from PL/SQL
Calling PL/SQL from Java
How Oracle JVM Handles Exceptions
8
Java Stored Procedures Application Example
Drawing the Entity-Relationship Diagram
Planning the Database Schema
Creating the Database Tables
Writing the Java Classes
Loading the Java Classes
Publishing the Java Classes
Calling the Java Stored Procedures
9
Oracle Database Java Application Performance
Oracle JVM Just-in-Time Compiler (JIT)
Overview of Oracle JVM JIT
Advantages of JIT Compilation
Methods Introduced in Oracle Database 11g
Java Memory Usage
Configuring Memory Initialization Parameters
Initializing Pool Sizes within Database Templates
Java Pool Memory
Displaying Used Amounts of Java Pool Memory
Correcting Out of Memory Errors
10
Security for Oracle Database Java Applications
Network Connection Security
Database Contents and Oracle JVM Security
Java2 Security
Setting Permissions
Fine-Grain Definition for Each Permission
General Permission Definition Assigned to Roles
Debugging Permissions
Permission for Loading Classes
Database Authentication Mechanisms
11
Schema Objects and Oracle JVM Utilities
Overview of Schema Objects
What and When to Load
Resolution of Schema Objects
Schema Object Digest Table
Compilation of Schema Objects
The ojvmtc Tool
The loadjava Tool
Syntax
Argument Summary
Argument Details
The dropjava Tool
Syntax
Argument Summary
Argument Details
Dropping Resources
The ojvmjava Tool
Syntax
Argument Summary
Example
Functionality
ojvmjava Options
Shell Commands
12
Database Web Services
Overview of Database Web Services
Using Oracle Database as Web Services Provider
How to Use JPublisher for Web Services Call-Ins
Features of Oracle Database as a Web Service Provider
Using Web Services with Oracle XML DB
JPublisher Support for Web Services Call-Ins to Oracle Database
Using Oracle Database as Web Services Consumer
How to Use Oracle Database for Web Services Call-Outs
Web Service Data Sources (Virtual Table Support)
Features of Oracle Database as a Web Service Consumer
Overview of JPublisher Generation
Adjusting the Mapping of SQL Types
A
DBMS_JAVA Package
longname
shortname
get_compiler_option
set_compiler_option
reset_compiler_option
resolver
derivedFrom
fixed_in_instance
set_output
start_debugging
stop_debugging
restart_debugging
export_source
export_class
export_resource
loadjava
dropjava
grant_permission
restrict_permission
grant_policy_permission
revoke_permission
disable_permission
enable_permission
delete_permission
set_preference
runjava
runjava_in_current_session
set_property
get_property
remove_property
show_property
set_output_to_sql
remove_output_to_sql
enable_output_to_sql
disable_output_to_sql
query_output_to_sql
set_output_to_java
remove_output_to_java
enable_output_to_java
disable_output_to_java
query_output_to_java
set_output_to_file
remove_output_to_file
enable_output_to_file
disable_output_to_file
query_output_to_file
enable_output_to_trc
disable_output_to_trc
query_output_to_trc
endsession
endsession_and_related_state
set_native_compiler_option
unset_native_compiler_option
compile_class
compile_class
uncompile_class
uncompile_class
compile_method
compile_method
uncompile_method
uncompile_method
B
Classpath Extensions and User Classloaded Metadata
Classpath Extensions
jserverQuotedClassPathTermPrefix
jserverURLPrefix
jserverSpecialTokenPrefix
JSERVER_CP
JSERVER_SCHEMAc
jserver:/CP general syntax
User Classloaded Metadata
Index