Skip Headers
Oracle® Database 2 Day + Java Developer's Guide
11g Release 1
Part Number B28765-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
1
Using Java with Oracle Database
Using Java to Connect to Oracle Database
Oracle JDBC Thin Driver
Oracle JDBC OCI Driver
Oracle JDBC Packages
Using JDeveloper to Create JDBC Applications
JDeveloper User Interface
JDeveloper Tools
Overview of Sample Java Application
Advanced Application Development Using Developer Frameworks
2
Getting Started with the Application
What You Need to Install
Oracle Database Server
Modifying the HR Schema for the JDBC Application
Oracle Database Client
J2SE or JDK
Integrated Development Environment
Web Server
Verifying the Oracle Database Client Installation
Checking Installed Directories and Files
Checking the Environment Variables
Determining the JDBC Driver Version
Installing Oracle JDeveloper
JDeveloper Studio Edition: Base Installation and Full Installation
Steps to Install JDeveloper
Starting JDeveloper
3
Connecting to Oracle Database
Connecting to Oracle Database from JDeveloper
JDeveloper Connection Navigator
Creating a Database Connection
Browsing the Data Using the Connection Navigator
Setting Up Applications and Projects in JDeveloper
Using the JDeveloper Application Navigator
Creating an Application and a Project
Viewing the Javadoc and Source Code Available in the Project Scope
Connecting to Oracle Database from a Java Application
Overview of Connecting to Oracle Database
Specifying Database URLs
Using the Default Service Feature of the Oracle Database Client
Creating a Java Class in JDeveloper
Java Libraries
Overview of the Oracle JDBC Library
Overview of the JSP Runtime Library
Adding JDBC and JSP Libraries
Importing JDBC Packages
Declaring Connection-Related Variables
Creating the Connection Method
4
Querying for and Displaying Data
Overview of Querying for Data in Oracle Database
SQL Statements
Query Methods for the Statement Object
Result Sets
Features of ResultSet Objects
Summary of Result Set Object Types
Querying Data from a Java Application
Creating a Method in JDeveloper to Query Data
Testing the Connection and the Query Methods
Creating JSP Pages
Overview of Page Presentation
JSP Tags
Scriptlets
HTML Tags
HTML Forms
Creating a Simple JSP Page
Adding Static Content to a JSP Page
Adding a Style Sheet to a JSP Page
Adding Dynamic Content to the JSP Page: Database Query Results
Adding a JSP useBean Tag to Initialize the DataHandler Class
Creating a Result Set
Adding a Table to the JSP Page to Display the Result Set
Filtering a Query Result Set
Creating a Java Method for Filtering Results
Testing the Query Filter Method
Adding Filter Controls to the JSP Page
Displaying Filtered Data in the JSP Page
Adding Login Functionality to the Application
Creating a Method to Authenticate Users
Creating a Login Page
Preparing Error Reports for Failed Logins
Creating the Login Interface
Creating a JSP Page to Handle Login Action
Testing the JSP Page
5
Updating Data
Creating a JavaBean
Creating a JavaBean in JDeveloper
Defining the JavaBean Properties and Methods
Updating Data from a Java Class
Creating a Method to Identify an Employee Record
Creating a Method to Update Employee Data
Adding a Link to Navigate to an Update Page
Creating a JSP Page to Edit Employee Data
Creating a JSP Page to Handle an Update Action
Inserting an Employee Record
Creating a Method to Insert Data
Adding a Link to Navigate to an Insert Page
Creating a JSP Page to Enter New Data
Creating a JSP Page to Handle an Insert Action
Deleting an Employee Record
Creating a Method for Deleting Data
Adding a Link to Delete an Employee
Creating a JSP Page to Handle a Delete Action
Exception Handling
Adding Exception Handling to Java Methods
Creating a Method for Handling Any SQLException
Navigation in the Sample Application
Creating a Starting Page for an Application
6
Enhancing the Application: Advanced JDBC Features
Using Dynamic SQL
Using OraclePreparedStatement
Using OracleCallableStatement
Using Bind Variables
Calling Stored Procedures
Creating a PL/SQL Stored Procedure in JDeveloper
Creating a Method to Use the Stored Procedure
Allowing Users to Choose the Stored Procedure
Calling the Stored Procedure from the Application
Using Cursor Variables
Oracle REF CURSOR Type Category
Accessing REF CURSOR Data
Using REF CURSOR in the Sample Application
Creating a Package in the Database
Creating a Database Function
Calling the REF CURSOR from a Method
Displaying a Dynamically Generated List
7
Creating a Master-Detail Application Using Oracle ADF
Overview of the Master-Detail Application
Using Oracle ADF
Oracle ADF Business Components
Oracle ADF Faces
Facets Usage with Oracle ADF Faces
ADF Data Controls
Creating an Application and Projects
Creating Business Components in the model Project
Displaying Master-Detail Data
Creating a Project for the Application UI
Creating a JSP to Display Employee Details
Defining the Page Layout and Heading
Displaying Master Data on a JSP Page
Displaying Detail Data for Master Records
Testing the Application
Navigation Between Application Pages: JSF Navigation Diagrams
Creating a Page Using a JSF Navigation Diagram
Navigating Between Pages
Defining Navigation Between Pages
Editing Data
Creating an Edit Form
Navigating to an Edit Page
Enabling COMMIT and ROLLBACK
Running the Application
8
Getting Unconnected from Oracle Database
Creating a Method to Close All Open Objects
Closing Open Objects in the Application
9
Building Global Applications
Developing Locale Awareness
Mapping Between Oracle and Java Locales
Determining User Locales
Locale Awareness in Java Applications
Encoding HTML Pages
Specifying the Page Encoding for HTML Pages
Specifying the Page Encoding in Java Servlets and JSP Pages
Organizing the Content of HTML Pages for Translation
Strings in Java Servlets and JSP Pages
Static Files
Data from the Database
Presenting Data by User Locale Convention
Oracle Date Formats
Oracle Number Formats
Oracle Linguistic Sorts
Oracle Error Messages
Localizing Text on JSP Pages in JDeveloper
Creating a Resource Bundle
Using Resource Bundle Text on JSP Pages
Index