Go to main content
1/120
Contents
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 12
c
Release 2 (12.2)
Oracle JDBC Thin Driver
Oracle JDBC Packages
Using JDeveloper to Create JDBC Applications
JDeveloper User Interface
JDeveloper Tools
Overview of Sample Java Application
Resources
2
Getting Started with the Application
What You Need to Install
Oracle Database 12
c
Release 2 (12.2)
Unlocking the HR Schema for the JDBC Application
J2SE or JDK
Integrated Development Environment
Web Server
Verifying the Oracle Database 12
c
Release 2 (12.2) Installation
Checking Installed Directories and Files
Checking the Environment Variables
Determining the JDBC Driver Version
Installing Oracle JDeveloper
3
Connecting to Oracle Database 12
c
Release 2 (12.2)
Connecting to Oracle Database from JDeveloper
JDeveloper Database Navigator
Creating a Database Connection
Browsing the Data Using the Database 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
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
Enabling 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
Getting Unconnected from Oracle Database 12
c
Release 2 (12.2)
Creating a Method to Close All Open Objects
Closing Open Objects in the Application
8
Creating a Universal Connection Pool
Setting JDeveloper Project Properties
Creating the Stock Ticker Application
Observing the Output
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
Scripting on this page enhances content navigation, but does not change the content in any way.