Stephen Asbury, Scott R. Weiner - Developing Java Enterprise Apps.pdf

(3276 KB) Pobierz
Microsoft Word - Developing Java Enterprise Applications -- Wiley.doc
15400399.001.png 15400399.002.png
John Wiley & Sons © 1999, 780 pages
ISBN: 0471327565
A tutorial and reference for serious developers interested in
learning how to build large applications using Java.
Table of Contents
Back Cover
Synopsis by Alan Zeichick
Once upon a time, Java was viewed as a language for building tiny Web
applications. No longer. With the rise of advanced standards such as JDBC,
Java can talk to nearly all relations or object databases; thanks to JNDI, Java
can access directory services; Sun's specification for Enterprise JavaBeans
allows developers to build distributed applications which can communicate
with each other; the Java Messaging Service provides for applications to
"publish" and "subscribe" to services, and so on. Java's time as a serious
programming platform has arrived, and this book provides not only a detailed
description of today's Java platform, but all of the enhanced specifications
mentioned above. Thanks to its clear explanations, this book is valuable for
developers or their managers considering the use of Java for enterprise-scale
applications. The inclusion of complete examples and source code makes it
even more valuable for current Java developers looking to understand all of
the capabilities unleashed by this new programming technology.
Table of Contents
Developing Java™ Enterprise Applications - 3
Chapter 1 - An Introduction to Java Enterprise Development - 10
Chapter 2 - What Is JDBC? - 15
Chapter 3 - Basic JDBC Programming - 20
Chapter 4 - What Is JNDI? - 69
Chapter 5 - Using JNDI - 75
Chapter 6 - What Are Servlets? - 125
Chapter 7 - Programming Servlets - 135
Chapter 8 - A Servlet-Based Search Engine - 197
Chapter 9 - What Is Server-Side Scripting? - 214
Chapter 10 - Creating JavaServer Pages - 226
Chapter 11 - A JavaServer Page Online Store - 259
Chapter 12 - Overview of Distributed Objects - 281
Chapter 13 - Introduction to Java RMI - 290
Chapter 14 - A Network File-Locking Server - 321
- 2 -
Developing Java Enterprise Applications
by Stephen Asbury and Scott R. Weiner
Introduction - 5
15400399.003.png 15400399.004.png
Chapter 15 - What Are Enterprise JavaBeans? - 338
Chapter 16 - Programming Enterprise JavaBeans - 346
Chapter 17 - Deploying Enterprise JavaBeans - 399
Chapter 18 - Enterprise JavaBean Business Rules Engine - 404
Chapter 19 - What Are Messaging and the Java Messaging Service? - 430
Chapter 20 - Programming with the Java Messaging Service - 435
Chapter 21 - A JMS-Based Alarm System - 489
Chapter 22 - Transactions, JTA, and JTS - 511
Chapter 23 - Using Transactions with Enterprise JavaBeans - 515
Chapter 24 - Architecture Review - 531
Chapter 25 - A Four-Tier Online Store - 539
Chapter 26 - MiniJMS: A Java Messaging Service Provider - 592
Appendix A - JDBC Information - 671
Appendix B - What’s on the CD-ROM? - 681
Back Cover
Stephen Asbury and Scott Weiner – two of Sun’s favorite Java programming
trainers – provide easy-to-digest instructions for the major Java Enterprise
APIs and their associated programming tools and products. They describe
proven techniques for combining these APIs to create powerful enterprise
applications and discuss the role middleware products play in the enterprise
development process. You’ll learn how to:
Program with Java Enterprise APIs like RMI, Servlets, JDBC, JNDI,
JTS, and others
Build N-Tier transactions applications with Enterprise JavaBeans
Create messaging applications with Java Messaging Service (JMS)
Build a servlet search engine for your Web site
Create an online store with JavaServer Pages (JSP)
About the Authors
Stephen Asbury and Scott R. Weiner are cofounders of Paradigm Research,
Inc., a training company that specializes in object-oriented programming with
Java, JavaScript, and other Web technologies.
Developing Java™ Enterprise Applications
Stephen Asbury
Publisher: Robert Ipsen
Editor: Theresa Hudson
Assistant Editor: Kathryn A. Malm
Managing Editor: Angela Murphy
Electronic Products, Associate Editor: Mike Sosa
Text Design & Composition: Benchmark Productions, Inc.
- 3 -
Scott R. Weiner
Designations used by companies to distinguish their products are often claimed as
trademarks. In all instances where John Wiley & Sons, Inc., is aware of a claim, the
product names appear in initial capital or all capital letters. Readers, however, should
contact the appropriate companies for more complete information regarding trademarks
and registration.
Copyright © 1999 by Stephen Asbury and Scott R. Weiner. All rights reserved.
Published by John Wiley & Sons, Inc.
No part of this publication may be reproduced, stored in a retrieval system or transmitted
in any form or by any means, electronic, mechanical, photocopying, recording, scanning
or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States
Copyright Act, without either the prior written permission of the Publisher, or authorization
through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222
Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 750-4744. Requests to
the Publisher for permission should be addressed to the Permissions Department, John
Wiley & Sons, Inc., 605 Third Avenue, New York, NY 10158-0012, (212) 850-6011, fax
(212) 850-6008, E-Mail: PERMREQ @ WILEY.COM.
This publication is designed to provide accurate and authoritative information in regard to
the subject matter covered. It is sold with the understanding that the publisher is not
engaged in professional services. If professional advice or other expert assistance is
required, the services of a competent professional person should be sought.
Dedication
For my friends and the lessons they taught that were sometimes hard to learn.
—Stephen Asbury
For my wife Susan, who is special in too many ways to list here. For my daughter Emily,
who comes to kiss me goodnight right about the time I start to work on the book each
night. They both make me smile and I just wanted them to know I appreciate their
patience, love and support.
—Scott Weiner
Acknowledgments
First, we would both like to thank the PRI gang; Alberto, Brad, Eric, Ethan, Glen, John,
Karen, Kerry, Nicole, Shrinand, and Tyler. Sometimes writing takes away from work and
we appreciate their dedication in our stead. Special thanks to Ethan for his LDAP
expertise and Alberto for listening to Stephen complain about another late night, a fouled
up example, or basically anything worth commiserating about.
And where would authors be without editors? Many thanks to Terri Hudson, Kathryn
Malm, and Gerrie Cho for transforming our sometimes confused expositions into logical
explanations.
Finally, unending thanks to our wives Cheryl and Susan. You can only apologize for
coming to bed at 3 a.m. and working through the weekend so many times before you
realize that the person you keep apologizing to knew long before you did what your
decision to write a book entailed. I know from my experience that Cheryl is always two or
more steps ahead of me, and although I kick myself for not figuring it out sooner, I
wouldn’t have it any other way. I bet if you asked Scott about Sue, he would tell you the
same thing.
- 4 -
Published simultaneously in Canada.
— Stephen Asbury
About the Authors
Stephen Asbury is the Chief Technology Officer for Paradigm Research, Inc. This is
Stephen’s fourth book on Web technology. He has also authored numerous courses on
Java, JavaScript, Active Server pages, HTML and just about everything else that Web
programmers need to know. In addition, Stephen has designed and built two Web-based
training environments and a number of other commercial applications and frameworks.
Stephen lives in Sunnyvale, California with his beloved wife Cheryl.
Scott Weiner is president of Paradigm Research, Inc. He has been involved in
consulting with object-oriented design and programming for over ten years. Before
founding Paradigm Research, Scott ran a mentoring program for NeXT Computers where
he helped Fortune 1000 companies embrace object-oriented techniques for creating
mission-critical applications. Today, Scott is leading Paradigm Research on a mission to
create the best training for development teams leveraging leading-edge technologies and
corporate end-users using the latest productivity applications. Scott lives in Northern
California with his wife Susan, his beautiful one-year-old daughter, Emily, and their two
dogs, Casey and Jake.
Introduction
Overview
Java is steadily becoming the language of choice for new enterprise-wide development
projects. A number of factors have lead to this explosion in Java’s popularity as a
programming language and in particular as a language for large scale development
projects. If you are reading this book, we expect that you already have some familiarity
with Java as a programming language, and won’t bore you with the laundry list of
marketing buzz words that are often used to excite folks about Java. Instead, we have
focused this book on the enterprise technologies that Sun is standardizing for the Java
developers. These technologies, as standards, are motivating numerous companies to
move their new projects onto the Java platform.
Our goal for Developing Java Enterprise Applications is to provide developers and
evaluators alike an opportunity to learn about Java enterprise development at a
technology level and from the perspective of a real world project. There are a number of
emerging Java technologies and we have taken a snapshot of the available libraries,
frameworks, and tools. Certainly, the list of available technologies will grow, but this book
should serve as a solid foundation for your Java development.
Currently the main technologies being adopted, or about to be adopted, by enterprise
developers include JDBC for database connectivity, the Java Naming and Directory
Interface (JNDI) for accessing services, and RMI for Java remote method invocation and
distributed objects. On top of this foundation are Servlets, JavaServer Pages, Enterprise
Java Beans, Java Messaging Service, and Transaction Management. All of these
combine into a feature-rich tool kit for developing Java applications.
What about CORBA?
You may have noticed that in all this discussion, we have made no mention of one of the
more pervasive and potential influential technologies in enterprise development, CORBA.
In researching and writing this book, we realized that their just wasn’t room to do CORBA,
and the Java technologies for accessing it, justice. Seeing the number of books that just
discuss Java and CORBA, we decided that our time, and your money were better served
discussing the other technologies well and leaving CORBA for a separate manuscript. We
- 5 -
Zgłoś jeśli naruszono regulamin