J2EE™ Foundations
Summary
This five-day course covers some basic elements of the J2EE™
platform. It consists of three units, each introducing one major technology.
Database connectivity with JDBC™ is covered in the first unit. Following
this the emphasis shifts to web technologies, with Java™ Servlets and
Java Server Pages.
Prerequisites
Prerequisites: Experience in Java Programming is essential. The
student must be comfortable with object-oriented Java, interfaces and
abstract classes. Understanding of basic SQL usage or other work with
relational databases will be helpful, but is not required.
Exposure to HTML and Web page design are also beneficial but not necessary.
Length
5 Days
Format
Instructor-led course, with practical computer-based exercises.
Unit 1: JDBC
This one-day unit covers the fundamentals of database programming in
Java using JDBC (Java Database connectivity) in an incremental
fashion, to get the programmer up to speed quickly and then to layer a
deeper understanding of JDBC upon that foundation. This unit has
been designed to work with any of three relational database management
systems:
Apache Derby, version 10
MySQL, version 4.1
Oracle, version 9i or 10g
Lab exercises use SQL99 constructs whenever possible in order to be
relevant to databases from all vendors. The software also
includes an optional overlay of workspace and project files to support
use of the Eclipse IDE in the classroom.
Unit Objectives
On completion of this unit, the student should be able to
Briefly review relational database fundamentals with an
awareness of the differences between SQL99 and SQL implementations by
database vendors.
Connect to a database using JDBC and perform a simple query.
Update relational data using JDBC to execute updates,
inserts and deletes.
Use prepared statements to produce reusable database queries
and optimize execution time.
Use callable statements to access database procedures.
Use scrollable and updatable results sets for more robust
solutions.
Use commit, rollback, and savepoint to build transactional
systems.
Use batch processing for efficient handling of large
datasets.
Understand the use of RowSets and the improved techniques
and portability that they bring to JDBC.
Unit Outline
1. Database and SQL Fundamentals
Relational Databases and SQL
Database, Schema, Tables, Columns and Rows
SQL Versions and Vendor Implementations
DDL Creating and Managing Database Objects
DML Retrieving and Managing Data
Sequences
Stored Procedures
Using SQL Terminals
2. JDBC Fundamentals
What is the JDBC API?
JDBC Drivers
Making a Connection
Creating and Executing a Statement
Retrieving Values from a ResultSet
SQL and Java Datatypes
SQL NULL Versus Java null
Creating and Updating Tables
Handling SQL Exceptions and Proper Cleanup
Handling SQLWarning
3. Advanced JDBC
SQL Escape Syntax
Using Prepared Statements
Using Callable Statements
Scrollable Result Sets
Updatable Result Sets
Transactions
Commits, Rollbacks, and Savepoints
Batch Processing
Alternatives to JDBC
4. Introduction to Row Sets
Row Sets in GUI and J2EE programming
Advantages of RowSets
RowSet Specializations
Using CachedRowSets
Appendix A. Learning Resources
Appendix B. Course Schema
Appendix C. Methods and Types
Unit 2: Introduction to Java Servlets
This practical, application-oriented unit teaches Java Servlets
technology and shows how to use it to develop simple to complex Web
applications. It is intended for experienced Java (J2SE) programmers
who want to build Web applications or J2EE components and systems.
The unit begins with an overview of server-side Java programming and
Web protocols. Then students learn the Java Servlets architecture,
the request/response cycle, and servlet life cycle, and how to build
interactive Web applications that parse and/or generate HTML forms.
Several prominent patterns for servlet application architecture are
considered. Sessions are studied as a means to developing
sophisticated client/server conversations over several HTML pages.
Multi-tier applications are developed using servlets and JDBC for
access to relational databases. The unit develops the important
concept of the separation of programmatic and declarative
development: use of configuration and context information in lieu of
hard-coded values, resource locations, etc., to make the Web
application as portable and easy to administer as possible. The
unit introduces JavaBeans as a standard for business and data
objects that can be shared among servlets and JSPs, and develops
techniques for sharing such objects at session scope or by request
forwarding. Finally, students learn how to implement filters to adapt
existing servlets by pre- and post-processing the request and
response.
Unit Objectives
On completion of this unit, the student should be able to
Understand and appreciate the role of Java Servlets in the
overall Java 2 Enterprise Edition architecture, and as the best Java
solution to HTTP application development
Use request and response objects provided to a servlet to
read CGI parameters and to produce an HTML response
Develop interactive Web applications using HTML forms and
servlets
Manage complex conversations with HTTP clients using session
attributes
Understand the role of JDBC™ in Java persistence code, and
use JDBC for persistence in servlet applications
Preserve portability and ease of administration for a
servlet application by parameterizing servlet code, using
initialization parameters, properties files, and JNDI
Use JavaBeans classes to share complex business data between
components
Implement filters to adapt existing servlets with new
features, and to maximize the decomposition of logic between vertical
business functions and horizontal facilities
Unit Outline
1. Web Applications
Server-Side Programming
Web Protocols and Web Applications
Role of Web Servers
Java Servlets
Using Tomcat Web server
Structure of a Java Servlet
2. Servlets Architecture
Servlets Architecture
Servlet and HttpServlet
Request and Response
Reading Request Parameters
Producing an HTML Response
Redirecting the Web Server
Deployment Descriptors
Servlets Life Cycle
Relationship to the Container
3. Interactive Web Applications
Building an HTML Interface
HTML Forms
Handling Form Input
Application Architecture
Single-Servlet Model
Multiple-Servlet Model
Routing Servlet Model
Template Parsers
4. Session Management
Managing Client State
Sessions
Session Implementations
HttpSession
Session Attributes
Session Events
Invalidating Sessions
5. Database Access
JDBC
JDBC Drivers
Using JDBC in a Servlet
Data Access Objects
Threading Issues
Transactions
Connection Pooling
6. Configuration and Context
The Need for Configuration
Initialization Parameters
Properties Files
JNDI and the Component Environment
JDBC Data Sources
Working with XML Data
7. Filters
Servlet Filters
Uses for Filters
Building a Filter
Filter Configuration and Context
Filter Chains
Deploying Filters
Learning Resources
Unit 3: Introduction to Java Server Pages
This two-day unit introduces JavaServer Pages, or JSP™, which is the
standard means of authoring dynamic content for Web applications under
the Java Enterprise platform. The unit begins with an introduction
of Web applications in general, shows how Java servlets and JSPs
establish a framework for writing Web applications, and then covers
JSP 2.0 features in detail, from scripting elements to use of
dedicated JavaBeans to JSP expressions, and quick introductions of
JSTL and custom tag development.
By the end of the unit students will be able to create their own JSP
applications, including interactive applications using HTML forms and
pages that perform fairly complex processing using scripts and or
actions. Although scripting is covered, the scriptless authoring
style encouraged by the JSP 2.0 specification is emphasized, and
students will be well equipped to develop concise and effective JSP
applications.
Unit Objectives
On completion of this unit, the student should be able to
Explain the fundamentals of HTML and HTTP in the World Wide
Web.
Describe the CGI and its role in implementing interactive
Web applications.
Describe JavaServer Pages and their relationship to servlets
and J2EE generally.
Describe how a JSP is translated into a servlet and
processed at runtime.
Explain the use of directives on JSPs and outline the
principal directives.
Implement simple JSPs that use Java code in declarations,
expressions and scriptlets.
Enumerate and use the implicit objects available to
scripting elements.
Explain the use of HTML forms in Web applications.
Implement an interactive Web application using JSP.
Use Java exception handling and JSP error pages to handle
errors in JSP applications.
Implement session management for a JSP application.
Manage cookies to store client-specific information at
various scopes and durations.
Explain the use of JavaBeans in JSP and their role in
enhancing the separation of business logic from page design.
Use Beans to implement effective interactive JSP
applications.
Describe the use of the JSP expression language in
simplifying dynamic page output.
Write JSP expressions and implement JSPs that use them in
favor of scripts.
Describe the role of the JSP Standard Tag Library in JSP
development.
Implement JSPs that use basic JSTL actions to simplify
presentation logic.
Describe custom tags in JSP and explain how they are
implemented, both using Java and JSP itself, and how they are used.
Discuss threading issues in JSP and describe the use of
directives to control how threading is handled.
Describe the various uses of XML in JSP applications.
Deploy a logical Web application to a Web server in a WAR
file.
Unit Outline
1. Web Applications
The World Wide Web
HTML
Web Servers
HTTP
Dynamic Web Pages
CGI
Java Web Technologies
Servlets
JSP
2. JSP Architecture
JSP Containers
Servlet Architecture
Page Translation
Types of JSP Content
Directives
Content Type
Buffering
Scripting Elements
JSP Expressions
Standard Actions
Custom Actions and JSTL
Objects and Scopes
Implicit Objects
JSP Lifecycle
3. Scripting Elements
Translation of Template Content
Scriptlets
Expressions
Declarations
Dos and Donts
Implicit Objects for Scriptlets
The request Object
The response Object
The out Object
4. Interactive JSP Applications
HTML Forms
Reading CGI Parameters
JSPs and Java Classes
Error Handling
Session Management
The Session API
Cookies and JSP
5. Using JavaBeans
Separating Presentation and Business Logic
JSP Actions
JavaBeans
Working with Properties
and
Using Form Parameters with Beans
Objects and Scopes
Working with Vectors
6. The Expression Language and the JSTL
Going Scriptless
The JSP Expression Language
EL Syntax
Type Coercion
Error Handling
Implicit Objects for EL
The JSP Standard Tag Library
Role of JSTL
The Core Actions
Using Beans with JSTL
The Formatting Actions
Scripts vs. EL/JSTL
7. Advanced JSP Features
Web Components
Forwarding
Inclusion
Passing Parameters
Custom Tag Libraries
Tag Library Architecture
Implementing in Java or JSP
Threads
Strategies for Thread Safety
XML and JSP
JSP for Web Services
Learning Resources
Hardware and Software Requirements
Unit 1
This course has been tested on Windows 2000 and XP. The J2SE™ 1.4.2
SDK is required. The course supports the following database software:
Apache Derby 10 (formerly Cloudscape) this product is
included with the course software and is the default
MySQL 4.1 this is a free downloadable and the Connector/J
driver is included with the course software
Oracle 9i or 10g no license or software is included with the
course
Hardware requirements are modest: a minimal system for this module
would have a Pentium 500MHz or equivalent CPU, 256 meg of RAM and at
least 500 megabytes of free disk space for tools installation and lab
software. For Oracle systems, significantly better processing power
and memory is recommended see Oracles own documentation for this.
The basic course uses command-line scripts and a freeware text
editor. An optional package is available with workspace and project
definitions for Eclipse 3.01.
Unit 2
This unit can be presented on Windows or Linux systems. Tools
required are all free downloadables available for either platform:
the J2SE™ SDK, the Tomcat 5 Web server, the MySQL RDBMS and a MySQL
JDBC driver. Hardware requirements are modest: a good minimal system
for this unit would have a Pentium 500MHz or equivalent CPU, 256 meg
of RAM and at least 500 megabytes of free disk space for tools
installation and lab software.
Unit 3
This unit can be presented on Windows or Linux systems. The J2SE™
SDK and the Tomcat 5 Web server are required both are free
downloadables available for either platform. Hardware requirements
are modest: a good minimal system for this module would have a Pentium
500MHz or equivalent CPU, 256 meg of RAM and at least 500 megabytes of
free disk space for tools installation and lab software.
Go to course catalogue
Oracle and Java are registered trademarks of Oracle and/or its affiliates.
PL/SQL and SQL*Plus are trademarks or registered trademarks of Oracle
Corporation. Microsoft is either a registered trademark or trademark of Microsoft
Corporation in the United States and/or other countries. MVS is a registered
trademark of the International Business Machines Corp. in the U.S. or other
countries or both. Motif, OSF/1, UNIX, and the "X Device" are registered
trademarks and IT DialTone and The Open Group are trademarks of The Open Group
in the U.S. and other countries. All other trademarks are the property of
their respective owners.
For comments or problems, please mail
webmaster@datadeliverance.com