Java Programming Language

Similar documents
Java EE Patterns. Student Guide - Volume 1. SL-500 Rev C.0.1. D61856GC10 Edition 1.0 D62465

Business Component Development with EJB Technology, Java EE 5

Fundamentals of the Java Programming Language

Sun Java System Application Server 8.1: Administration & Deployment

Sun Virtualization: Solaris 10 Containers Administration

Web Component Development with Servlet and JSP Technologies, Java EE 6

Object-Oriented Analysis and Design Using UML

Shell Programming for System Administrators Student Guide

MySQL and PHP - Developing Dynamic Web Applications

Sun Certified System Administrator for the Solaris 10 OS Bootcamp

JOSE LUIS JUAREZ VIVEROS com) has a. non-transferable license to use this Student Guide

OracleAS 10g R3: Java Programming

Oracle 10g: Java Programming

OracleAS 10g R3: Build J2EE Applications II

Oracle Forms Developer 10g: Move to the Web

Oracle Fusion Middleware

E Oracle 10g Java Bootcamp I v1

Deploying Applications to Oracle WebLogic Server g Release 1 (10.3.6)

Oracle Data Integrator: Administration and Development Volume I Student Guide

Modeling Network Integrity Release 7.3.1

Oracle Java CAPS Database Binding Component User's Guide

Configuring Oracle Java CAPS Master Index (Repository) Connectivity and Environments

Oracle Adaptive Access Manager: Administration Student Guide

Oracle BI Publisher 11g R1: Fundamentals

Oracle Hyperion Data Relationship Management Administration Activity Guide

Oracle VM Administration: Oracle VM Server for x86 Student Guide

MySQL Performance Tuning

JavaFX. JavaFX System Requirements Release E

Oracle Data Integrator 11g: Integration and Administration Student Guide - Volume I

E Oracle 10g Java Bootcamp II v1

Oracle Communications Configuration Management

Oracle BI 11g R1: Build Repositories

Database Change Reference Release 6.3

Oracle GoldenGate 11g: Advanced Configuration for Oracle Student Guide

Oracle WebLogic Server 12c: Administration I

Defining Constants and Variables for Oracle Java CAPS Environments

Oracle Communications MetaSolv Solution. XML API Developer s Reference Release 6.2.1

Configuring Oracle Business Intelligence Enterprise Edition to Support Teradata Database Query Banding

Oracle BI Publisher 10g R3: Fundamentals

Oracle Application Server 10g R2: Administration II

Oracle VM Server for x86: Administration

GlassFish Server Open Source Edition

Installation Instructions: Oracle XML DB XFILES Demonstration. An Oracle White Paper: November 2011

Securing Resources Using Roles and Policies for Oracle WebLogic Server c (12.1.3)

Oracle Hospitality Query and Analysis Languages and Translation Configuration Guide. March 2016

Microsoft Active Directory Plug-in User s Guide Release

NetBeans IDE Field Guide

Oracle Enterprise Manager

Oracle Enterprise Manager

Siebel CRM Integration to Oracle FLEXCUBE Universal Banking Implementation Guide. Version 1.0 (Siebel CRM Version 8.2), Rev.

Sun Certified System Administrator for the Solaris 10 OS Bootcamp

JD Edwards EnterpriseOne Tools

Importing an SNA Custom Handshake Class

Contents at a Glance

Siebel 8.1.x Fundamentals Student Guide

PeopleSoft Fluid Required Fields Standards

Oracle Application Testing Suite: Introduction Student Guide

Oracle WebCenter Portal. Starting Points for Oracle WebCenter Portal Installation

Oracle Service Bus 10g R3: Design & Integrate Services for SOA

Oracle Hospitality Suite8 Export to Outlook User Manual Release 8.9. July 2015

Creating Domain Templates Using the Domain Template Builder 11g Release 1 (10.3.6)

Oracle Fusion Middleware. About XDS Usage. Configuring the XDS Connector for Oracle WebCenter Content. 11g Release 1 (11.1.1)

Oracle Hospitality Suite8 XML Export of Invoice Data for Hungarian Tax Authority Release and Higher E November 2016

Microsoft Internet Information Services (IIS) Plug-in User s Guide Release

Oracle Identity Manager 11g: Essentials

Oracle Fusion Middleware

Oracle Enterprise Manager Ops Center. Introduction. What You Will Need. Installing and Updating Local Software Packages 12c Release

Web Application Development Using JEE, Enterprise JavaBeans and JPA

General Security Principles

EnterpriseTrack Reporting Data Model Configuration Guide Version 17

Oracle Fusion Middleware

Oracle Communication and Mobility Server: Introduction Student Guide

open source community experience distilled

Oracle Application Express: Administration Student Guide

Oracle Enterprise Pack for Eclipse

Oracle Enterprise Manager. 1 Introduction. System Monitoring Plug-in for Oracle Enterprise Manager Ops Center Guide 11g Release 1 (

About the CORBA Cartridge

Oracle Data Integrator 11g: Advanced Integration and Development Student Guide

An Oracle White Paper December, 3 rd Oracle Metadata Management v New Features Overview

Oracle Banking APIs. Part No. E Third Party Simulation Guide Release April 2018

Oracle Fusion Middleware

IBM Operational Decision Manager Version 8 Release 5. Configuring Operational Decision Manager on Java SE

Oracle Fusion Middleware

Web Application Development Using JEE, Enterprise JavaBeans and JPA

Using Java - for PL/SQL and Database Developers Student Guide

JD Edwards EnterpriseOne Licensing

CO Java EE 7: Back-End Server Application Development

Oracle BPM 10g R3 Programming 1 Essentials

UNIX and Linux Essentials Student Guide

Oracle WebCenter Content 11g: Content Server Customization Student Guide - Volume I

Java EE Application Assembly & Deployment Packaging Applications, Java EE modules. Model View Controller (MVC)2 Architecture & Packaging EJB Module

Oracle Cloud. Using Oracle Social Network Release E

Oracle Fusion Middleware Oracle Stream Analytics Release Notes. 12c Release ( )

JavaFX. JavaFX Overview Release E

Oracle WebCenter Portal

Oracle Communications Order and Service Management

Oracle Hospitality BellaVita Adding a New Language Release 2.7. September 2015

Oracle Content Server 11g: Administration

Oracle WebLogic Server 12c: JMS Administration Student Guide

Rational Application Developer 7 Bootcamp

Transcription:

Java Programming Language Additional Material SL-275-SE6 Rev G D61750GC10 Edition 1.0 D62603

Copyright 2007, 2009, Oracle and/or its affiliates. All rights reserved. Disclaimer This document contains proprietary information, is provided under a license agreement containing restrictions on use and disclosure, and is protected by copyright and other intellectual property laws. You may copy and print this document solely for your own use in an Oracle training course. The document may not be modified or altered in any way. Except as expressly permitted in your license agreement or allowed by law, you may not use, share, download, upload, copy, print, display, perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the express authorization of Oracle. The information contained in this document is subject to change without notice. If you find any problems in the document, please report them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not warranted to be error-free. Sun Microsystems, Inc. Disclaimer This training manual may include references to materials, offerings, or products that were previously offered by Sun Microsystems, Inc. Certain materials, offerings, services, or products may no longer be offered or provided.oracle and its affiliates cannot be held responsible for any such references should they appear in the text provided. Restricted Rights Notice If this documentation is delivered to the U.S. Government or anyone using the documentation on behalf of the U.S. Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS The U.S. Government s rights to use, modify, reproduce, release, perform, display, or disclose these training materials are restricted by the terms of the applicable Oracle license agreement and/or the applicable U.S. Government contract. Trademark Notice Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. UNIX is a registered trademark licensed through X/Open Company, Ltd.

This page intentionally left blank.

This page intentionally left blank.

Table of Contents About This Book...Preface-xi Goals... Preface-xi Book Map...Preface-xii Typographical Conventions...Preface-xiii Additional Conventions...Preface-xiv The NetBeans IDE 5.5...1-1 Objectives... 1-1 The Netbeans IDE 5.5 Release... 1-2 Downloading the NetBeans IDE... 1-2 NetBeans IDE Resources... 1-2 Help System... 1-3 Launching the NetBeans IDE... 1-4 Shutting Down the NetBeans IDE... 1-5 Increasing the Font Size of the IDE... 1-5 Using the Update Center of the IDE... 1-5 Java Development...2-1 Objectives... 2-1 Java Application Projects... 2-2 Project Types... 2-2 Creating Projects... 2-2 Opening Projects... 2-3 Building Projects... 2-3 Cleaning Projects... 2-4 Running Projects... 2-4 Main Project... 2-5 Project Source Folders... 2-5 Modifying Project Libraries... 2-6 Closing a Project... 2-7 Deleting a Project... 2-7 Adding Ant Targets to a Project... 2-7 Executing Customized Ant Targets... 2-8 Setting the Main Class... 2-8 v

Setting Arguments... 2-9 Setting the Virtual Machine Options... 2-10 Java Packages... 2-11 Creating Java Packages... 2-11 Modifying Java Packages... 2-11 Renaming Packages... 2-11 Deleting Packages... 2-12 Compiling Java Packages... 2-12 Java Classes... 2-13 Java Class Types... 2-13 JUnit Test Classes... 2-14 Empty Test... 2-14 Creating Java Classes... 2-14 Opening Java Classes... 2-15 Modifying Java Classes... 2-15 Adding Fields... 2-15 Adding Properties... 2-16 Renaming Fields... 2-18 Encapsulating Fields... 2-19 Removing Fields... 2-20 Adding Methods... 2-21 Refactoring Methods... 2-21 Removing Methods... 2-21 Overriding Methods... 2-22 Adding Constructors... 2-22 Adding Static Initializers... 2-23 Calling an Enterprise Bean... 2-23 Adding Database Lookup Code to a Java Class File... 2-23 Sending a JMS Message to a Message-Driven Bean... 2-24 Compiling Java Classes... 2-24 Executing Java Programs... 2-24 Main Classes... 2-25 JUnit Test Classes... 2-25 Copying Java Classes... 2-25 Moving Java Classes... 2-26 Copying Existing Resources... 2-27 Terminating a Running Process... 2-28 XML Files... 2-29 Creating XML Files... 2-29 Opening XML Files... 2-29 Checking and Validating XML Files... 2-30 Other Files... 2-31 File Types... 2-31 Creating New Files... 2-31 Opening Files... 2-31 Creating Folders... 2-32 vi The Netbeans IDE Tool Reference

Deleting Files... 2-32 Copying Files and Folders... 2-32 Moving Files and Folders... 2-32 Java EE Development...3-1 Objectives... 3-1 Enterprise Application Projects... 3-2 Creating Enterprise Application Projects... 3-2 Configuring Deployment Descriptors... 3-3 Editing the Standard Application Deployment Descriptor... 3-3 Editing the SJSAS-Specific Application Deployment Descriptor... 3-4 Adding Build Packages... 3-4 Building Java EE Applications... 3-5 Verifying Java EE Applications... 3-5 Deploying Java EE Applications... 3-6 Undeploying Java EE Applications... 3-6 Configuring Java EE Resources... 3-7 Configuring Connection Pools... 3-7 Creating a Connection Pool Resource... 3-7 Registering a Connection Pool Resource... 3-8 Configuring JDBC Resources... 3-8 Creating a JDBC Resource... 3-9 Registering a JDBC Resource... 3-9 Configuring JMS Resources... 3-10 Creating a JMS Resource... 3-10 Registering a JMS Resource with the Sun Java System Application Server... 3-10 Deleting a JMS Resource from the EJB Module... 3-11 Removing a JMS Resource From the Sun Java System Application Server... 3-11 Web Modules... 3-12 Web Application Projects... 3-12 Creating a Web Application Project... 3-12 Servlets... 3-14 Creating Servlets... 3-14 Deleting Servlets... 3-15 Creating JavaServer Pages... 3-16 Editing JSP Pages... 3-17 HTML Files... 3-17 Web Application Listeners... 3-18 Creating Listener Classes... 3-18 Deleting Listener Classes... 3-19 Filter Classes... 3-19 Creating Filters... 3-19 vii

Deleting Filters... 3-20 Web Application Frameworks... 3-20 Adding Frameworks... 3-20 Struts Action Classes... 3-23 Creating Struts Action Classes... 3-23 Deleting Struts Action Classes... 3-24 Struts ActionForm Beans... 3-25 Creating Struts ActionForm Beans... 3-25 Deleting Struts ActionForm Beans... 3-26 Web Deployment Descriptors... 3-26 Opening the Standard Deployment Descriptor... 3-26 General Configuration... 3-27 Servlet Configuration... 3-28 Filter Configuration... 3-31 Page Configuration... 3-33 Reference Configuration... 3-35 Security Configuration... 3-36 XML Editor... 3-38 Sun Java System Application Server Web Deployment Descriptor... 3-38 Opening the Sun Java System Application Server Web Deployment Descriptor... 3-39 EJB Modules... 3-41 Creating EJB Modules... 3-41 Session Beans... 3-42 Creating Session Beans... 3-42 Adding Business Methods... 3-42 Removing Methods... 3-44 Entity Classes... 3-44 Creating Persistence Units... 3-44 Creating Entity Classes... 3-45 Creating Entity Classes From a Database... 3-46 Message-Driven Beans... 3-47 Configuring EJB Deployment Descriptors... 3-48 Creating the Standard EJB Deployment Descriptor... 3-48 Opening the Standard EJB Deployment Descriptor... 3-48 The XML Editor... 3-49 The Sun EJB Deployment Descriptor... 3-49 Web Services... 3-50 Creating an Empty Web Service... 3-50 Creating a Web Service From a WSDL File... 3-51 Adding Operations to a Web Service... 3-52 Refreshing Web Services... 3-52 Editing Web Service Attributes... 3-52 Testing Web Services... 3-53 Creating WSDL Files... 3-53 viii The Netbeans IDE Tool Reference

Creating Web Service Clients... 3-54 Calling a Web Service Operation... 3-55 Refreshing Web Services and Clients... 3-55 Message Handlers... 3-55 Creating Message Handlers... 3-55 Configuring Message Handlers... 3-56 Deployment Descriptor Settings... 3-56 Server Resources...4-1 Objectives... 4-1 Java EE Application Servers... 4-2 Registering Application Servers... 4-2 Starting the Application Servers... 4-3 Examining Application Servers... 4-3 Configuring Application Servers... 4-4 ORB Settings... 4-4 Stopping Application Servers... 4-5 Examining Server Log Files... 4-5 Classpath Settings... 4-5 Adding JVM Machine Options... 4-6 Modifying SOAP Message Security Settings... 4-6 Administering Security... 4-7 Adding a File Realm User... 4-7 Administering the Java Message Service... 4-7 Creating Physical Destinations... 4-7 Deploying to a Server... 4-7 Deploying WAR Files... 4-8 Deploying EJB JAR Files... 4-8 Deploying EAR Files... 4-8 Databases... 4-9 Starting the Java DB Database... 4-9 Creating a Java DB Database... 4-9 Modifying the Java DB Database Location... 4-10 Stopping the Java DB Database... 4-10 Adding JDBC Drivers... 4-10 Connecting to Databases... 4-11 Interacting with Databases... 4-11 Executing SQL Queries... 4-12 Capturing Database Schemas... 4-12 NetBeans 5.5 Keyboard Shortcuts... A-1 Keyboard Shortcuts... A-2 ix

Java EE Annotation Reference...B-1 Resource Annotations...B-2 EJB Annotations...B-3 Bean-Type Annotations...B-3 Transaction and Security Annotations...B-3 Callback Annotations...B-4 Interceptor Annotations...B-4 x The Netbeans IDE Tool Reference