Skip Headers

Oracle9i Java Stored Procedures Developer's Guide
Release 2 (9.2)

Part Number A96659-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to next page


Preface

Who Should Read This Guide?

Anyone developing Java applications for Oracle9i will benefit from reading this guide. Written especially for programmers, it will also be of value to architects, systems analysts, project managers, and others interested in network-centric database applications. To use this guide effectively, you must have a working knowledge of Java, SQL, PL/SQL, and Oracle9i.


Note:

This guide presumes you are an experienced Java programmer. If you are just learning Java, see "Suggested Reading".


How This Guide Is Organized

This guide enables you to build Java applications for Oracle. Working from simple examples, you quickly learn how to load, publish, and call Java stored procedures.

This guide is divided into the following five chapters:

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 Corporation 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 Corporation does not own or control. Oracle Corporation neither evaluates nor makes any representations regarding the accessibility of these Web sites.

Notational Conventions

This guide follows these conventions:

Convention Meaning

Italic

Italic font denotes terms being defined for the first time, words being emphasized, error messages, and book titles.

Courier

Courier font denotes program code, schema object names, file names, path names, and Internet addresses.

Java code examples follow these conventions:

Convention Meaning

{ }

Braces enclose a block of statements.

//

A double slash begins a single-line comment, which extends to the end of a line.

/* */

A slash-asterisk and an asterisk-slash delimit a multi-line comment, which can span multiple lines.

...

An ellipsis shows that statements or clauses irrelevant to the discussion were left out.

lower case

We use lower case for keywords and for one-word names of variables, methods, and packages.

UPPER CASE

We use upper case for names of constants (static final variables) and for names of supplied classes that map to built-in SQL datatypes.

Mixed Case

We use mixed case for names of classes and interfaces and for multi-word names of variables, methods, and packages. The names of classes and interfaces begin with an upper-case letter. In all multi-word names, the second and succeeding words begin with an upper-case letter.

PL/SQL code examples follow these conventions:

Convention Meaning

--

A double hyphen begins a single-line comment, which extends to the end of a line.

/* */

A slash-asterisk and an asterisk-slash delimit a multi-line comment, which can span multiple lines.

...

An ellipsis shows that statements or clauses irrelevant to the discussion were left out.

lower case

We use lower case for names of constants, variables, cursors, exceptions, subprograms, and packages.

UPPER CASE

We use upper case for keywords, names of predefined exceptions, and names of supplied PL/SQL packages.

Mixed Case

We use mixed case for names of user-defined datatypes and subtypes. The names of user-defined types begin with an upper-case letter.

Syntax definitions use a simple variant of Backus-Naur Form (BNF) that includes the following symbols:

Symbol Meaning

[ ]

Brackets enclose optional items.

{ }

Braces enclose items of which only one is required.

|

A vertical bar separates alternatives within brackets or braces.

...

An ellipsis shows that the preceding syntactic element can be repeated.

delimiters

Delimiters other than brackets, braces, vertical bars, and ellipses must be entered as shown.

Sample Database Tables

Most programming examples in this guide use two sample database tables named dept and emp. Their definitions follow:

CREATE TABLE dept (deptno NUMBER(2) NOT NULL,
                   dname  VARCHAR2(14),
                   loc    VARCHAR2(13));

CREATE TABLE emp (empno    NUMBER(4) NOT NULL,
                  ename    VARCHAR2(10),
                  job      VARCHAR2(9),
                  mgr      NUMBER(4),
                  hiredate DATE,
                  sal      NUMBER(7,2),
                  comm     NUMBER(7,2),
                  deptno   NUMBER(2));

Respectively, the dept and emp tables contain the following rows of data:

DEPTNO  DNAME      LOC
------- ---------- ---------
10      ACCOUNTING NEW YORK
20      RESEARCH   DALLAS
30      SALES      CHICAGO
40      OPERATIONS BOSTON

EMPNO ENAME   JOB          MGR  HIREDATE    SAL   COMM  DEPTNO
----- ------- --------- ------ --------- ------ ------ -------
 7369 SMITH   CLERK       7902 17-DEC-80    800             20
 7499 ALLEN   SALESMAN    7698 20-FEB-81   1600    300      30
 7521 WARD    SALESMAN    7698 22-FEB-81   1250    500      30
 7566 JONES   MANAGER     7839 02-APR-81   2975             20
 7654 MARTIN  SALESMAN    7698 28-SEP-81   1250   1400      30
 7698 BLAKE   MANAGER     7839 01-MAY-81   2850             30
 7782 CLARK   MANAGER     7839 09-JUN-81   2450             10
 7788 SCOTT   ANALYST     7566 19-APR-87   3000             20
 7839 KING    PRESIDENT        17-NOV-81   5000             10
 7844 TURNER  SALESMAN    7698 08-SEP-81   1500      0      30
 7876 ADAMS   CLERK       7788 23-MAY-87   1100             20
 7900 JAMES   CLERK       7698 03-DEC-81    950             30
 7902 FORD    ANALYST     7566 03-DEC-81   3000             20
 7934 MILLER  CLERK       7782 23-JAN-82   1300             10

To create and load the tables, run the script demobld.sql, which can be found in the SQL*Plus demo directory.

Related Publications

Occasionally, this guide refers you to the following Oracle publications for more information:

Oracle9i Application Developer's Guide - Fundamentals
Oracle9i Java Developer's Guide
Oracle9i JDBC Developer's Guide and Reference
Oracle9i SQLJ Developer's Guide and Reference
Oracle9i SQL Reference
SQL*Plus User's Guide and Reference

Suggested Reading

The Java Programming Language by Arnold & Gosling, Addison-Wesley
Coauthored by the originator of Java, this definitive book explains the basic concepts, areas of applicability, and design philosophy of the language. Using numerous examples, it progresses systematically from basic to advanced programming techniques.
Thinking in Java by Bruce Eckel, Prentice Hall
This book offers a complete introduction to Java on a level appropriate for both beginners and experts. Using simple examples, it presents the fundamentals and complexities of Java in a straightforward, good-humored way.
Core Java by Cornell & Horstmann, Prentice-Hall
This book is a complete, step-by-step introduction to Java programming principles and techniques. Using real-world examples, it highlights alternative approaches to program design and offers many programming tips and tricks.
Java in a Nutshell by Flanagan, O'Reilly
This indispensable quick reference provides a wealth of information about Java's most commonly used features. It includes programming tips and traps, excellent examples of problem solving, and tutorials on important features.
Java Software Solutions by Lewis & Loftus, Addison-Wesley
This book provides a clear, thorough introduction to Java and object-oriented programming. It contains extensive reference material and excellent pedagogy including self-assessment questions, programming projects, and exercises that encourage experimentation.

Online Sources

There are many useful online sources of information about Java. For example, you can view or download guides and tutorials from the Sun Microsystems home page on the Web:

http://www.sun.com

Another popular Java Web site is:

http://www.gamelan.com

For Java API documentation, visit:

http://www.javasoft.com/products

Also, the following Internet news groups are dedicated to Java:

comp.lang.java.programmer
comp.lang.java.misc

At the following site, you can get the latest Oracle JVM news, updates, and offerings:

http://www.oracle.com/java

In addition to try-and-buy tools, you can download JDBC drivers, SQLJ reference implementations, white papers on Java application development, and collections of frequently asked questions (FAQs).


Go to previous page Go to next page
Oracle
Copyright © 2000, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback