ebook img

WebSphere 4.0 AEs workbook for Eenterprise JavaBeans, 3rd edition PDF

168 Pages·2002·3.328 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview WebSphere 4.0 AEs workbook for Eenterprise JavaBeans, 3rd edition

Order the bound version of this book from http://www.titan-books.com About the Series Each of the books in this series is a server-specific companion to the third edition of Richard Monson-Haefel's best-selling and award-winning Enterprise JavaBeans (O'Reilly 2001), available at http://www.titan-books.com/ and at all major retail outlets. It guides the reader step by step through the exercises called out in that work, explains how to build and deploy working solutions in a particular application server, and provides useful hints, tips, and warnings. These workbooks are published by Titan Books in the context of a friendly agreement with O'Reilly and Associates, the publishers of Enterprise JavaBeans, to provide serious developers with the best possible foundation for success in EJB development on their chosen platforms. Series Titles Available WebLogic™ Server 6.1 Workbook for Enterprise JavaBeans™ 3rd Edition WebSphere™ 4.0 AEs Workbook for Enterprise JavaBeans™ 3rd Edition J2EE™ 1.3 SDK Workbook for Enterprise JavaBeans™ 3rd Edition Order the bound version of this book from http://www.titan-books.com WebSphere™ 4.0 AEs Workbook for Enterprise JavaBeans™ 3rd Edition Kyle Brown Minneapolis Order the bound version of this book from http://www.titan-books.com WebSphere 4.0 AEs Workbook for Enterprise JavaBeans, 3rd Edition, by Kyle Brown Published by Titan Books, Minneapolis, Minnesota. Series Editor: Brian Christeson Companion volume to Enterprise JavaBeans, 3rd Edition, by Richard Monson-Haefel, published by O'Reilly & Associates, Inc., 2001, available at http://www.titan-books.com/. Copyright © 2001 Titan Books, Inc. All rights reserved. Printed in the United States of America by Fidlar Doubleday, Inc. Printing History: October 2001 First Edition IBM, VisualAge, and WebSphere are trademarks or registered trademarks of IBM Corporation in the United States, other countries, or both. Microsoft, Windows, Windows NT, and the Windows logo are trademarks or registered trademarks of Microsoft Corporation in the United States, other countries, or both. Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States, other countries, or both. Other company, product, and service names may be trademarks or service marks of others. While every precaution has been taken in the preparation of this book, the publisher assumes no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein. ISBN 1-931822-47-6 Order the bound version of this book from http://www.titan-books.com For Ann and Nathaniel Order the bound version of this book from http://www.titan-books.com Table of Contents Table of Figures.......................................................................................... xi Preface........................................................................................................xv Contents of This Book............................................................................................................xv On-Line Resources................................................................................................................xvi Conventions Used in This Book..........................................................................................xvii Acknowledgements.............................................................................................................xvii Server Installation and Configuration.........................................................1 Downloading and Installing the Software............................................................1 Downloading IBM WebSphere Application Server AEs.........................................................1 Installing WebSphere AEs on Windows 2000 or Windows NT...........................................2 Downloading and Installing IBM DB2...................................................................................6 Before You Begin................................................................................................7 Understanding the exercises in this workbook......................................................................7 Setting up the sample database..............................................................................................8 Setting DB2 to Use JDBC 2.0................................................................................................11 An Introduction to J2EE and IBM WebSphere AEs.............................................................11 IBM WebSphere AEs Elements.............................................................................................14 Exercises for Chapter 4...............................................................................25 Exercise 4.1: A Simple Entity Bean....................................................................26 Step 1: Compile the Java source code...................................................................................26 Step 2: Create an EJB .jar file for the Cabin bean................................................................27 Step 3: Create application client .jar files.............................................................................27 Step 4: Use the AAT to assemble an enterprise archive (.ear) file.......................................42 Step 5: Use the AAT to generate deployment code for the .ear file.....................................48 Step 6: Use the DB2 Command Line Processor to create the Cabin bean table..................52 Step 7: Use the Administrative Console to create a DB2 data source..................................54 Step 8: Use the Administrative Console to deploy the EJB .jar file......................................57 Step 9: Test your clients with the launchClient tool............................................................64 vii WebSphere Workbook for Enterprise JavaBeans, 3rd Edition Exercise 4.2: A Simple Session Bean.................................................................68 Step 1: Compile the TravelAgent bean classes and build an EJB .jar file............................68 Step 2: Create an application client .jar file for the Client_3 test program.........................87 Step 3: Add the application client and the EJB to the .ear file............................................88 Step 4: Deploy the EJB .jar file to the server........................................................................90 Step 5: Run the Client_3 test program..................................................................................91 Exercises for Chapter 5.............................................................................. 93 Exercise 5.1: The Remote Component Interfaces...............................................94 Step 1: Compile the classes...................................................................................................94 Step 2: Create three new application client .jar files............................................................94 Step 3: Create the Client_51.ear file.....................................................................................95 Step 4: Test the application clients.......................................................................................95 Exercise 5.2: The EJBObject, Handle, and Primary Key.....................................99 Step 1: Compile the classes...................................................................................................99 Step 2: Create three new application client .jar files............................................................99 Step 3: Create the Client_53.ear file...................................................................................100 Step 4: Test the application clients.....................................................................................100 Exercise for Chapter 9..............................................................................103 Exercise 9.1: A CMP 1.1 Entity Bean.................................................................104 Step 1: Learn about WebSphere custom finder methods...................................................104 Step 2: Compile the Ship classes........................................................................................109 Step 3: Build the Ship EJB .jar file.....................................................................................109 Step 4: Build the application client .jar files......................................................................109 Step 5: Build the Ship .ear file.............................................................................................114 Step 6: Create the ShipEJB table.........................................................................................114 Step 7: Deploy the EJB .jar file for the Ship bean...............................................................114 Step 8: Run the Ship test clients..........................................................................................115 Exercise for Chapter 10..............................................................................117 Exercise 10.1: A BMP Entity Bean.....................................................................118 Step 1: Compile the Source Files.........................................................................................118 Step 2: Assemble the EJB .jar file........................................................................................118 Step 3: Create the application client .jar files......................................................................118 Step 4: Assemble the .ear file and generate the deployed .ear file......................................119 Step 5: Create the Ship table................................................................................................119 viii Order the bound version of this book from http://www.titan-books.com WebSphere Workbook for Enterprise JavaBeans, 3rd Edition Step 6: Deploy the EJB .jar file into WebSphere AEs.........................................................119 Step 7: Test the new EJB with the test clients....................................................................120 Exercises for Chapter 12........................................................................... 121 Exercise 12.1: A Stateless Session Bean...........................................................122 Step 1: Undeploy the existing Cabin and TravelAgent beans.............................................125 Step 2: Compile the Source Files.........................................................................................126 Step 3: Assemble the EJB .jar file........................................................................................127 Step 4: Create an application client .jar file........................................................................127 Step 5: Assemble the .ear file and generate the deployed .ear file.....................................130 Step 6: Create the database tables......................................................................................130 Step 7: Deploy the .ear file into WebSphere AEs................................................................132 Step 8: Test the new EJBs with the test client....................................................................135 Exercise 12.2: A Stateful Session Bean..............................................................137 Step 1: Compile the Source Files.........................................................................................137 Step 2: Assemble the EJB .jar file........................................................................................137 Step 3: Create an application client .jar file........................................................................137 Step 4: Create the .ear files.................................................................................................140 Step 5: Use SEAppInstall to deploy the new TravelAgent .ear file....................................140 Step 6: Launch the application client..................................................................................147 Order the bound version of this book from http://www.titan-books.com ix

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.