EC26 - Java / J2EE for Experienced C++ Programmers
Duration4 Days
AvailabilityCheck course price and availability

Target Audience

This course covers all major aspects of client / server programming with Java. It is essentially a condensed version of courses EC21 (Java Primer), EC22 (Java Programming) and EC31 (Java Servlet Programming) and is aimed at highly competent programmers who have detailed knowledge of similar programming techniques using C++.

Pre-requisites

It is stressed that due to the condensed agenda for this course, students must have a strong working knowledge of C++.

Course Objectives

The aim of this course is to give experienced C++ students a fully rounded general knowledge of client / server programming with Java providing not just basic skills but moving onto more advanced topics including Collections, Threads, I/O, Servlets and JavaServer Pages. During the course the student will write many applications, classes, servlets and JSPs ensuring that the statements taught are fully understood and practical experience is gained. On completion of this course the student will be able to:

  •     understand the fundamental language differences between C++ and Java
  •     Take advantage of and understand Interfaces
  •     Use the Collections Framework (both Java 1.1 and Java 1.2 implementations)
  •     Create and handle Exceptions
  •     Use the Java Input/Output classes
  •     Understand and use Serialization to achieve persistence
  •     Understand multi-threading and synchronization and use the various techniques available to create separate threads
  •     Write Servlets that interact with HTTP clients
  •     Understanding servlet multi-threading issues / pitfalls, session tracking and JavaBean manipulation.
  •     Write Applications/Servlets that manipulate records in a Database using JDBC
  •     Code effective JavaServer Pages using Model, View, Controller design pattern methodologies.

Course Environment

Development will be performed using:

  •     the Java Development Kit (JDK) plus a text editor
  •     JBuilder
  •     NetBeans
  •     Rational Application Developer
  •     Websphere Studio Application Developer
  •     Eclipse

Course Details

INTRODUCTION TO JAVA
What is Java?
The Java Programming Language
The Java Platform, Java installation - Path requirements
What Can Java Do?
Overview of the many subjects covered by Java
Advantages of using Java
Creating a java class
Running Simple Applications
A simple first example - The "Hello World" Application
THE JAVA / C++ DIFFERENCES
Variables
Usage Types, Data Types, Literal Values, Naming Standards, Scope, Initialisation, Constants, Escape Characters
Arrays & Multi-Dimentional Arrays
Strings
Strings are objects!, Concatenation, Testing for String equality, Manipulation
Creating & Manipulating Objects, Calling Methods, Passing Arguments and Method Overloading, Returning Values from Methods
Constructors, Static Code
Inheritance - Extending a Class
What does a Subclass Inherit?
PACKAGES
Packages, Using Package Members, Importing
THE INTEGRATED DEVELOPMENT ENVIRONMENT (if applicable)
Introduction to the IDE
A tour of the Workbench
Creating Projects
Importing and exporting
Working With Java
Fixing Problems, Creating new Classes and Interfaces
The Java Editor
Editing code and elements, Content/Code Assist, Code Formatter
Running and Debugging apps
ACCESSIBILITY MODIFIERS
Public or Private?!
Declaration Parameters
Class, Variable , Method
CASTING AND DATA CONVERSION
Literal Values, Implicit & Explicit Casting, Casting With Operators
Casting Objects, Narrowing & Widening
Data Type Conversion, Numeric Formatting
OBJECTS, METHODS AND CLASSES
Abstract Classes and Methods
Interfaces
Defining an Interface, Implementing an Interface
Inner Classes
Using an Inner Class to Implement an Adapter, Anonymous Inner Classes
The Garbage Collector - Cleaning up Unused Objects
Finalization
COLLECTIONS
Collection Interfaces And Implementations
Summary Of Collection Implementations
Lists: ArrayList, Vector, LinkedList
Maps: HashMap, Hashtable, TreeMap, LinkedHashMap
Sets: HashSet, TreeSet, LinkedHashSet
Iterator And Enumeration
Other Collections: Stacks, Properties
Sorting Objects
The Comparable Interface, Comparators
More ways to Sort Objects:
      java.util.Collections, java.util.Arrays
Collections Method Reference
THREADS & SYNCHRONIZATION
What is a Thread?
Creating Threads
Method 1 - Extending the Thread Class
Method 2 - Implementing the Runnable Interface
Controlling Threads
Thread Priority, Terminating Threads, Daemon Threads, Thread Synchronization
Applet Animation and Threads
Animation Flickering, Double Buffering to avoid flickering
Using an Inner Class to Handle Multiple Threads
ERROR HANDLING
Java Exceptions
Runtime and Checked Exceptions, Try / Catch Processing, The Finally Block
Passing Exceptions up the Stack
The throws statement
Creating new Exceptions
The Throw Statement, Error and Exception Classes, User Defined Exceptions
JAVA I/O
The Java I/O API
The File class, Input and Output Streams, Readers and Writers
Reading from System Input, Reading from Files, Standard Output Stream - System.out
Types of I/O classes
Buffering input/output, ByteArrays, CharArrays, DataStreams
Serialization - Persistence of Objects
DATABASE ACCESS
What is JDBC?
What alternatives are there? JDBC vs SQLJ
How does JDBC work?
JDBC Drivers and the JDBC API, Statements & Prepared Statements
Working with data
Accessing data - Working with Result Sets
Handling Warnings, Errors and NULL Values
Scalability Issues
Transaction Control and Isolation Levels
Configuring and using DataSources (using JNDI)
SQLJ
SQLJ Programming - Development Cycle using DB2
SQLJ Cursor Techniques
SERVLETS
Servlet Overview
Servlet vs CGI Advantages
The Java Servlet API
Servlet Life Cycle
Multi-threading issues / pitfalls
What Servlets Are
Non-Http Servlets - Implementing the Servlet Interface
Non-Http Servlets - Extending the GenericServlet class
Http Servlets - Extending the HttpServlet class
What Servlets do
HTML Get and Post Requests & Catering for both
Getting data to Servlets - the HttpRequest Object
Sending HTML back to the client - the HttpResponse Object
Using the Data sent to a Servlet
Form Validation
Data Validation
Servlet Security
Restricting Servlet Access
Error Handling
Server Error Codes
Server Side Includes
Extra HTML tags
Servlets can invoke other servlets
Dispatching a Resource from within a Servlet
USING THE IDE TO CODE SERVLETS
Creating Servlets
Testing Web Applications
Using the WebSphere test environment
ACCESSING DATABASES VIA SERVLETS
Servlets, JDBC and Connection Pooling
DataSource Definitions and Getting Database Connections via a DataSource
DATA SCOPE / PERSISTENCE
Variable Scope & Protection
Instance variables are shared!
Thread Safety - Synchronized Code
What is Request Scope?
Storing Objects for the lifetime of the Request
What is Session Scope?
Storing Objects for the lifetime of the Session
Session Tracking using Cookies, URL Rewriting, HiddenFields
Session Tracking API
Session Creation and Lookup, Storing and Retrieving Session API Information, Lifecycle, session tracking without Cookie support
Session Binding
What is Application Scope?
Sharing Data between different Servlets
JAVASERVER PAGES
JSP Overview
The Problem with Servlets - Why use JSPs?
How JSP Pages Are Executed
Writing a JavaServer Page
JSP Tags, Directive Tags, Scripting Tags & Scriptlets, Action Tags
JSP Pre-Defined Objects
Including Static and Dynamic Content
Forwarding execution to Servlets, JSP’s or HTML pages.
JSP Initialisation and Cleanup
USING THE IDE FOR JSP DEVELOPMENT
Testing JSPs
Testing and Debugging JSPs
JSP DESIGN PATTERNS
MVC Architecture
Where are JSPs used?
JSP Design Patterns
Stand alone JSPs, JSPs calling Servlets, JSPs accessing JavaBeans
Getting data from HTML Forms to JSPs
Handling HTML Forms
JavaBeans
Using JavaBeans
Form / Bean / JSP Interaction
Accessing JavaBeans from JSPs - JavaBean Tags
Getting Data from the Bean to the JSP Page
Variable and JavaBean Scopes
JSP Variable Scopes
JavaBean Scopes
Moving around!
Invoking a JSP from a Servlet
Passing Objects from Servlet to JSP
Passing JavaBeans from Servlet to JSP
Error Handling
The JSP Error Page
Full Shopping Cart Example

Course Format

Practical sessions make up a large part of the course, allowing delegates to demonstrate and reinforce the lectures given. During these sessions the delegate will build a simple but complete application. Examples are used extensively, ranging from simple code 'snippets' to full applications with complete ‘real world’ functionality. These are supplied at the start of the course and it is encouraged that the delegates execute and ‘experiment’ with these under the instructor’s guidance as they are introduced. These examples are available to take away, along with the delegate’s own work. The comprehensive Student Guide supplied is fully indexed serving as a useful reference tool long after the course has finished. Delegates will also be able to access a free help-line with technical questions relating to topics covered on the course.