SlideShare ist ein Scribd-Unternehmen logo
Rational Application Developer V6 Programming
Guide 2 Volume Set Ibm Redbooks download
https://ebookbell.com/product/rational-application-
developer-v6-programming-guide-2-volume-set-ibm-redbooks-2104608
Explore and download more ebooks at ebookbell.com
Here are some recommended products that we believe you will be
interested in. You can click the link to download.
Building Applications With Ibm Rational Application Developer And
Javabeans 1st Edition Colette Burrus Stephanie Parkin
https://ebookbell.com/product/building-applications-with-ibm-rational-
application-developer-and-javabeans-1st-edition-colette-burrus-
stephanie-parkin-36650514
Learning Postgresql Create Develop And Manage Relational Databases In
Real World Applications Using Postgresql 1st Edition Juba
https://ebookbell.com/product/learning-postgresql-create-develop-and-
manage-relational-databases-in-real-world-applications-using-
postgresql-1st-edition-juba-5313886
Polynomial And Rational Matrices Applications In Dynamical Systems
Theory 1st Edition Tadeusz Kaczorek Auth
https://ebookbell.com/product/polynomial-and-rational-matrices-
applications-in-dynamical-systems-theory-1st-edition-tadeusz-kaczorek-
auth-4192238
The Core Test Wrapper Handbook Rationale And Application Of Ieee Std
1500 1st Edition Francisco Da Silva
https://ebookbell.com/product/the-core-test-wrapper-handbook-
rationale-and-application-of-ieee-std-1500-1st-edition-francisco-da-
silva-4191612
Bounded Rational Choice Behaviour Applications In Transport Rasouli
https://ebookbell.com/product/bounded-rational-choice-behaviour-
applications-in-transport-rasouli-22052404
Noncommutative Rational Series With Applications Encyclopedia Of
Mathematics And Its Applications 1st Edition Jean Berstel
https://ebookbell.com/product/noncommutative-rational-series-with-
applications-encyclopedia-of-mathematics-and-its-applications-1st-
edition-jean-berstel-2323590
Homotopy Of Operads And Grothendieckteichmuller Groups Part 2 The
Applications Of Rational Homotopy Theory Methods Benoit Fresse
https://ebookbell.com/product/homotopy-of-operads-and-
grothendieckteichmuller-groups-part-2-the-applications-of-rational-
homotopy-theory-methods-benoit-fresse-10833004
Rational Bases And Generalized Barycentrics Applications To Finite
Elements And Graphics 1st Edition Eugene Wachspress Auth
https://ebookbell.com/product/rational-bases-and-generalized-
barycentrics-applications-to-finite-elements-and-graphics-1st-edition-
eugene-wachspress-auth-5353948
Rational Choice And Social Welfare Theory And Applications Essays In
Honor Of Kotaro Suzumura 1st Edition Maurice Salles Auth
https://ebookbell.com/product/rational-choice-and-social-welfare-
theory-and-applications-essays-in-honor-of-kotaro-suzumura-1st-
edition-maurice-salles-auth-4398702
Rational Application Developer V6 Programming Guide 2 Volume Set Ibm Redbooks
ibm.com/redbooks
Rational Application
Developer V6
Programming Guide
John Ganci
Fabio Ferraz
Hari Kanangi
Kiriya Keat
George Kroner
Juha Nevalainen
Nicolai Nielsen
Richard Raszka
Neil Weightman
Develop Java, Web, XML, database,
EJB, Struts, JSF, SDO, EGL, Web
Services, and portal applications
Test, debug, and profile with
built-in and remote servers
Deploy applications to
WebSphere Application
Server and WebSphere Portal
Front cover
Rational Application Developer V6 Programming Guide 2 Volume Set Ibm Redbooks
Rational Application Developer V6 Programming
Guide
June 2005
International Technical Support Organization
SG24-6449-00
© Copyright International Business Machines Corporation 2005. All rights reserved.
Note to U.S. Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADP
Schedule Contract with IBM Corp.
First Edition (June 2005)
This edition applies to IBM Rational Application Developer V6.0 and IBM WebSphere Application
Server V6.0.
Note: Before using this information and the product it supports, read the information in
“Notices” on page xxi.
© Copyright IBM Corp. 2005. All rights reserved. iii
Contents
Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
The team that wrote this redbook. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
Become a published author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvi
Comments welcome. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxvii
Summary of changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxvii
June 2005, First Edition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxvii
Part 1. Introduction to Rational Application Developer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Chapter 1. Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1 Introduction and concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1.1 IBM Rational Software Development Platform . . . . . . . . . . . . . . . . . . 4
1.1.2 Version 6 terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.1.3 Application development challenges. . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.1.4 Key themes of Version 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2 Product packaging. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.2.1 Rational Developer supported platforms and databases . . . . . . . . . . 9
1.2.2 Rational Application Developer V6 product packaging . . . . . . . . . . . 10
1.2.3 Rational Web Developer V6 product packaging . . . . . . . . . . . . . . . . 11
1.3 Product features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.3.1 Summary of new features in Version 6 . . . . . . . . . . . . . . . . . . . . . . . 14
1.3.2 Specification versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.3.3 Eclipse and IBM Rational Software Development Platform . . . . . . . 19
1.3.4 Test server environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.3.5 Licensing and installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.3.6 Migration and coexistence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
1.3.7 Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
1.4 Sample code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Chapter 2. Programming technologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.1 Desktop applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.1.1 Simple desktop applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.1.2 Database access. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.1.3 Graphical user interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.1.4 Extensible Markup Language (XML). . . . . . . . . . . . . . . . . . . . . . . . . 38
2.2 Static Web sites. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
iv Rational Application Developer V6 Programming Guide
2.2.1 Hypertext Transfer Protocol (HTTP) . . . . . . . . . . . . . . . . . . . . . . . . . 40
2.2.2 HyperText Markup Language (HTML) . . . . . . . . . . . . . . . . . . . . . . . 42
2.3 Dynamic Web applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.3.1 Simple Web applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
2.3.2 Struts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
2.3.3 JavaServer Faces (JSF) and Service Data Objects (SDO) . . . . . . . 52
2.3.4 Portal applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
2.4 Enterprise JavaBeans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
2.4.1 Different types of EJBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
2.4.2 Other EJB features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
2.4.3 Requirements for the development environment . . . . . . . . . . . . . . . 61
2.5 J2EE Application Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
2.5.1 Application Programming Interfaces (APIs) . . . . . . . . . . . . . . . . . . . 63
2.5.2 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
2.5.3 Naming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
2.5.4 Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
2.5.5 Requirements for the development environment . . . . . . . . . . . . . . . 65
2.6 Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
2.6.1 Web Services in J2EE V1.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
2.7 Messaging systems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
2.7.1 Java Message Service (JMS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
2.7.2 Message-driven EJBs (MDBs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
2.7.3 Requirements for the development environment . . . . . . . . . . . . . . . 72
Chapter 3. Workbench setup and preferences . . . . . . . . . . . . . . . . . . . . . . 75
3.1 Workbench basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
3.1.1 Workspace basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
3.1.2 Rational Application Developer log files . . . . . . . . . . . . . . . . . . . . . . 83
3.2 Preferences. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
3.2.1 Automatic builds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
3.2.2 Clean build (manual) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
3.2.3 Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
3.2.4 File associations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
3.2.5 Local history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
3.2.6 Perspectives preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
3.2.7 Internet preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
3.3 Java development preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
3.3.1 Java classpath variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
3.3.2 Appearance of Java elements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
3.3.3 Code style and formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
3.3.4 Compiler options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
3.3.5 Java editor settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
3.3.6 Installed JREs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Contents v
3.3.7 Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
3.3.8 Code review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Chapter 4. Perspectives, views, and editors. . . . . . . . . . . . . . . . . . . . . . . 131
4.1 Integrated development environment (IDE) . . . . . . . . . . . . . . . . . . . . . . 132
4.1.1 Rational Application Developer online help. . . . . . . . . . . . . . . . . . . 132
4.1.2 Perspectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
4.1.3 Views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
4.1.4 Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
4.1.5 Perspective layout. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
4.1.6 Switching perspectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
4.1.7 Specifying the default perspective . . . . . . . . . . . . . . . . . . . . . . . . . 140
4.1.8 Organizing and customizing perspectives. . . . . . . . . . . . . . . . . . . . 140
4.2 Available perspectives. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
4.2.1 CVS Repository Exploring perspective . . . . . . . . . . . . . . . . . . . . . . 143
4.2.2 Data perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
4.2.3 Debug perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
4.2.4 Generic Log Adapter perspective . . . . . . . . . . . . . . . . . . . . . . . . . . 148
4.2.5 J2EE perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
4.2.6 Java perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
4.2.7 Java Browsing perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
4.2.8 Java Type Hierarchy perspective . . . . . . . . . . . . . . . . . . . . . . . . . . 155
4.2.9 Plug-in Development perspective . . . . . . . . . . . . . . . . . . . . . . . . . . 157
4.2.10 Profiling and Logging perspective . . . . . . . . . . . . . . . . . . . . . . . . . 158
4.2.11 Resource perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
4.2.12 Team Synchronizing perspective . . . . . . . . . . . . . . . . . . . . . . . . . 160
4.2.13 Test perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
4.2.14 Web perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
4.2.15 Progress view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
4.3 Rational Product Updater . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Chapter 5. Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
5.1 J2EE architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
5.1.1 EAR files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
5.1.2 WAR files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
5.1.3 EJB JAR files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
5.1.4 J2EE Application Client JAR files . . . . . . . . . . . . . . . . . . . . . . . . . . 171
5.1.5 RAR files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
5.2 Projects and folders. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
5.3 Rational Application Developer projects . . . . . . . . . . . . . . . . . . . . . . . . . 173
5.3.1 Enterprise Application project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
5.3.2 J2EE Application Client project . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
5.3.3 Dynamic Web Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
vi Rational Application Developer V6 Programming Guide
5.3.4 Static Web Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
5.3.5 EJB project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
5.3.6 Connector project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
5.3.7 Java project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
5.3.8 Simple project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
5.3.9 Server project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
5.3.10 Component test project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
5.3.11 Checkout projects from CVS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
5.4 Creating a new project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
5.5 Project properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
5.6 Rational Application Developer samples. . . . . . . . . . . . . . . . . . . . . . . . . 181
5.6.1 The samples gallery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Part 2. Develop applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Chapter 6. RUP and UML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
6.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
6.2 Rational Unified Process (RUP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
6.2.1 Process Advisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
6.2.2 Process Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
6.2.3 Setting process preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
6.3 Visualize applications with UML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
6.3.1 Unified Modeling Language (UML) . . . . . . . . . . . . . . . . . . . . . . . . . 195
6.3.2 Browse diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
6.3.3 Topic Diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
6.3.4 Static Method Sequence Diagram . . . . . . . . . . . . . . . . . . . . . . . . . 203
6.3.5 Class Diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
6.3.6 Sequence Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
6.3.7 J2EE visualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
6.4 More information on UML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Chapter 7. Develop Java applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
7.1 Java perspective overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
7.1.1 Package Explorer view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
7.1.2 Call Hierarchy view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
7.1.3 Type Hierarch view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
7.1.4 Problems view. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
7.1.5 Declaration view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
7.1.6 Code review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
7.1.7 Outline view. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
7.1.8 Diagram Navigator view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
7.2 Develop the Java Bank application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
7.2.1 Java Bank application overview . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
7.2.2 Create a Java Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Contents vii
7.2.3 Create a class diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
7.2.4 Create Java packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
7.2.5 Create a Java interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
7.2.6 Create Java classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
7.2.7 Create the Java attributes and accessor methods . . . . . . . . . . . . . 254
7.2.8 Add method declarations to an interface. . . . . . . . . . . . . . . . . . . . . 258
7.2.9 Add Java methods and constructors. . . . . . . . . . . . . . . . . . . . . . . . 262
7.2.10 Define relationships (extends, implements, association) . . . . . . . 267
7.2.11 Implement the methods for each class . . . . . . . . . . . . . . . . . . . . . 270
7.2.12 Run the Java Bank application . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
7.3 Additional features used for Java applications . . . . . . . . . . . . . . . . . . . . 286
7.3.1 Locating compile errors in your code . . . . . . . . . . . . . . . . . . . . . . . 287
7.3.2 Running your programs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
7.3.3 Debug your programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
7.3.4 Java Scrapbook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
7.3.5 Pluggable Java Runtime Environment (JRE) . . . . . . . . . . . . . . . . . 296
7.3.6 Add a JAR file to the classpath . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
7.3.7 Export the Java code to a JAR file . . . . . . . . . . . . . . . . . . . . . . . . . 299
7.3.8 Run the Java application external to Application Developer . . . . . . 301
7.3.9 Import a Java JAR file into a project . . . . . . . . . . . . . . . . . . . . . . . . 301
7.3.10 Utility Java Projects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
7.3.11 Javadoc. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
7.4 Java editor and Rapid Application Development. . . . . . . . . . . . . . . . . . . 311
7.4.1 Navigate through the code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
7.4.2 Source folding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
7.4.3 Type hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
7.4.4 Smart Insert. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
7.4.5 Mark occurrences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
7.4.6 Word skipping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
7.4.7 Smart compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
7.4.8 Java search. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
7.4.9 Working sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
7.4.10 Quick Assist (Quick Fix) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
7.4.11 Code Assist (content) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
7.4.12 Import generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
7.4.13 Generate getters and setters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
7.4.14 Override/implement methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
7.4.15 Adding constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
7.4.16 Refactoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
Chapter 8. Develop Java database applications . . . . . . . . . . . . . . . . . . . 333
8.1 Introduction to Java database programming . . . . . . . . . . . . . . . . . . . . . . 334
8.1.1 JDBC overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
viii Rational Application Developer V6 Programming Guide
8.1.2 Data source versus direct connection . . . . . . . . . . . . . . . . . . . . . . . 335
8.1.3 XMI and DDL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
8.1.4 Rational Application Developer database features . . . . . . . . . . . . . 336
8.2 Preparing for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
8.2.1 Import the BankDB sample project . . . . . . . . . . . . . . . . . . . . . . . . . 337
8.2.2 Set up the BANK sample database. . . . . . . . . . . . . . . . . . . . . . . . . 338
8.3 Data perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
8.3.1 Data Definition view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
8.3.2 Database Explorer view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
8.3.3 DB Output view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
8.3.4 Navigator view. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
8.4 Create databases and tables from scripts. . . . . . . . . . . . . . . . . . . . . . . . 343
8.4.1 Create a database. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
8.4.2 Create a database connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
8.4.3 Create the database tables from scripts . . . . . . . . . . . . . . . . . . . . . 349
8.4.4 Populate database tables with data . . . . . . . . . . . . . . . . . . . . . . . . 352
8.5 Create and work with database objects . . . . . . . . . . . . . . . . . . . . . . . . . 354
8.5.1 Create a database. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
8.5.2 Create a database connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
8.5.3 Create a schema. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
8.5.4 Create a table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
8.5.5 Generate a DDL file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
8.5.6 Deploy DDL from the workspace to a database . . . . . . . . . . . . . . . 362
8.5.7 Copy database objects from a DDL file to a workspace . . . . . . . . . 362
8.5.8 Generate DDL and XSD files for database objects. . . . . . . . . . . . . 365
8.6 UML visualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
8.6.1 Class diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
8.6.2 Information engineering (IE) diagrams . . . . . . . . . . . . . . . . . . . . . . 374
8.6.3 IDEF1X (Integrated Definition Extended) diagrams . . . . . . . . . . . . 375
8.7 Create SQL statements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
8.7.1 Using the SQL Statement wizard . . . . . . . . . . . . . . . . . . . . . . . . . . 376
8.7.2 Using the SQL Query Builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
8.8 Access a database from a Java application . . . . . . . . . . . . . . . . . . . . . . 389
8.8.1 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
8.8.2 Access the database using the DriverManager . . . . . . . . . . . . . . . 390
8.8.3 Access using a data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
8.9 Java stored procedures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
8.9.1 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
8.9.2 Create a Java stored procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
8.9.3 Build a stored procedure (deploy to database) . . . . . . . . . . . . . . . . 405
8.9.4 Java DriverManager access to a Java stored procedure . . . . . . . . 408
8.9.5 JavaBean access to Java stored procedure . . . . . . . . . . . . . . . . . . 409
Contents ix
Chapter 9. Develop GUI applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
9.1 Introduction to the Visual Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
9.2 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
9.2.1 Create the project for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . 417
9.2.2 Add JDBC driver for Cloudscape to project . . . . . . . . . . . . . . . . . . 417
9.2.3 Set up the sample database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
9.2.4 Import the model classes for the sample . . . . . . . . . . . . . . . . . . . . 419
9.3 Launching the Visual Editor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
9.3.1 Create a visual class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
9.3.2 Open an existing class with the Visual Editor . . . . . . . . . . . . . . . . . 422
9.4 Visual Editor overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
9.4.1 Visual Editor layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
9.4.2 Customizing the appearance of the Visual Editor . . . . . . . . . . . . . . 424
9.5 Work with the Visual Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
9.5.1 Resize a JavaBean component . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
9.5.2 Code synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
9.5.3 Changing the properties of a component . . . . . . . . . . . . . . . . . . . . 428
9.5.4 Add JavaBeans to a visual class. . . . . . . . . . . . . . . . . . . . . . . . . . . 428
9.5.5 Work with the Properties view. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
9.5.6 Testing the appearance of the GUI . . . . . . . . . . . . . . . . . . . . . . . . . 433
9.5.7 Add event handling to GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
9.5.8 Verify the Java GUI application. . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
9.5.9 Run the sample GUI as a Java application . . . . . . . . . . . . . . . . . . . 436
9.5.10 Automatically add event handling . . . . . . . . . . . . . . . . . . . . . . . . . 437
9.5.11 Visual Editor binding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
Chapter 10. Develop XML applications . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
10.1 XML overview and technologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
10.1.1 XML and XML processor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
10.1.2 DTD and XML schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
10.1.3 XSL and XSLT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
10.1.4 XML namespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
10.1.5 XPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
10.2 Rational Application Developer XML tools . . . . . . . . . . . . . . . . . . . . . . 447
10.2.1 Create a project for XML sample . . . . . . . . . . . . . . . . . . . . . . . . . 448
10.2.2 Work with DTD files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
10.2.3 Work with XML schema files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
10.2.4 Work with XML files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
10.2.5 Work with XSL files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
10.2.6 Transform an XML file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
10.2.7 Java code generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
10.3 Where to find more information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
x Rational Application Developer V6 Programming Guide
Chapter 11. Develop Web applications using JSPs and servlets. . . . . . 499
11.1 Introduction to Web applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
11.1.1 Concepts and technologies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
11.1.2 Model-view-controller (MVC) pattern . . . . . . . . . . . . . . . . . . . . . . 503
11.2 Web development tooling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
11.2.1 Web perspective and views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
11.2.2 Web Projects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
11.2.3 Web Site Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
11.2.4 Page Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509
11.2.5 Page templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
11.2.6 CSS Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
11.2.7 Javascript Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
11.2.8 WebArt Designer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
11.2.9 AnimatedGif Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
11.2.10 File creation wizards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
11.3 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
11.3.1 ITSO Bank Web application overview. . . . . . . . . . . . . . . . . . . . . . 514
11.3.2 Create a Web Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
11.3.3 Web Project directory structure. . . . . . . . . . . . . . . . . . . . . . . . . . . 522
11.3.4 Import the ITSO Bank model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524
11.4 Define the site navigation and appearance. . . . . . . . . . . . . . . . . . . . . . 524
11.4.1 Launch the Web Site Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
11.4.2 Create a new page template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526
11.4.3 Customize a page template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
11.4.4 Customize a style sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
11.4.5 Create the Web site navigation and pages . . . . . . . . . . . . . . . . . . 538
11.4.6 Verify the site navigation and page templates . . . . . . . . . . . . . . . 542
11.5 Develop the static Web resources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
11.5.1 Create the index.html page content (text, links) . . . . . . . . . . . . . . 544
11.5.2 Create the rates.html page content (tables) . . . . . . . . . . . . . . . . . 546
11.5.3 Create the insurance.html page content (list) . . . . . . . . . . . . . . . . 547
11.5.4 Create the redbank.html page content (forms) . . . . . . . . . . . . . . . 548
11.6 Develop the dynamic Web resources . . . . . . . . . . . . . . . . . . . . . . . . . . 549
11.6.1 Creating model classes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
11.6.2 Working with servlets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576
11.6.3 Working with JSPs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
11.7 Test the application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610
11.7.1 Prerequisites to run sample Web application . . . . . . . . . . . . . . . . 611
11.7.2 Run the sample Web application . . . . . . . . . . . . . . . . . . . . . . . . . 611
11.7.3 Verify the sample Web application . . . . . . . . . . . . . . . . . . . . . . . . 611
Chapter 12. Develop Web applications using Struts . . . . . . . . . . . . . . . . 615
12.1 Introduction to Struts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
Contents xi
12.1.1 Model-view-controller (MVC) pattern with Struts. . . . . . . . . . . . . . 616
12.1.2 Rational Application Developer support for Struts . . . . . . . . . . . . 619
12.2 Prepare for the sample application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620
12.2.1 ITSO Bank Struts Web application overview . . . . . . . . . . . . . . . . 620
12.2.2 Create a Dynamic Web Project with Struts support . . . . . . . . . . . 622
12.2.3 Add JDBC driver for Cloudscape to project . . . . . . . . . . . . . . . . . 628
12.2.4 Set up the sample database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
12.2.5 Configure the data source. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
12.3 Develop a Web application using Struts . . . . . . . . . . . . . . . . . . . . . . . . 632
12.3.1 Create the Struts components . . . . . . . . . . . . . . . . . . . . . . . . . . . 632
12.3.2 Realize the Struts components . . . . . . . . . . . . . . . . . . . . . . . . . . . 640
12.3.3 Modify ApplicationResources.properties. . . . . . . . . . . . . . . . . . . . 652
12.3.4 Struts validation framework. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653
12.3.5 Page Designer and the Struts tag library . . . . . . . . . . . . . . . . . . . 655
12.3.6 Using the Struts configuration file editor . . . . . . . . . . . . . . . . . . . . 659
12.4 Import and run the Struts sample application . . . . . . . . . . . . . . . . . . . . 665
12.4.1 Import the Struts Bank Web application sample . . . . . . . . . . . . . . 665
12.4.2 Prepare the application and sample database . . . . . . . . . . . . . . . 666
12.4.3 Run the Struts Bank Web application sample. . . . . . . . . . . . . . . . 666
Chapter 13. Develop Web applications using JSF and SDO . . . . . . . . . . 673
13.1 Introduction to JSF and SDO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674
13.1.1 JavaServer Faces (JSF) overview . . . . . . . . . . . . . . . . . . . . . . . . 674
13.1.2 Service Data Objects (SDO) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678
13.2 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678
13.2.1 Create a Dynamic Web Project. . . . . . . . . . . . . . . . . . . . . . . . . . . 679
13.2.2 Set up the sample database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681
13.2.3 Configure the data source via the enhanced EAR . . . . . . . . . . . . 681
13.3 Develop a Web application using JSF and SDO. . . . . . . . . . . . . . . . . . 684
13.3.1 Create a page template. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684
13.3.2 Useful views for editing page template files . . . . . . . . . . . . . . . . . 687
13.3.3 Customize the page template . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
13.3.4 Create JSF resources using the Web Diagram tool . . . . . . . . . . . 700
13.3.5 Edit a JSF page. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715
13.3.6 Completing the SDO example. . . . . . . . . . . . . . . . . . . . . . . . . . . . 730
13.4 Run the sample Web application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746
13.4.1 Prerequisites to run sample Web application . . . . . . . . . . . . . . . . 746
13.4.2 Run the sample Web application . . . . . . . . . . . . . . . . . . . . . . . . . 747
13.4.3 Verify the sample Web application . . . . . . . . . . . . . . . . . . . . . . . . 747
Chapter 14. Develop Web applications using EGL . . . . . . . . . . . . . . . . . 751
14.1 Introduction to EGL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 752
14.1.1 Programming paradigms. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 752
xii Rational Application Developer V6 Programming Guide
14.1.2 IBM Enterprise Generation Language. . . . . . . . . . . . . . . . . . . . . . 753
14.1.3 IBM EGL and Rational brand software . . . . . . . . . . . . . . . . . . . . . 758
14.1.4 IBM EGL feature enhancements. . . . . . . . . . . . . . . . . . . . . . . . . . 759
14.1.5 Where to find more information on EGL . . . . . . . . . . . . . . . . . . . . 761
14.2 IBM EGL tooling in Rational Developer products . . . . . . . . . . . . . . . . . 761
14.2.1 EGL preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761
14.2.2 EGL perspective and views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 762
14.2.3 EGL projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763
14.2.4 EGL wizards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763
14.2.5 EGL migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 764
14.2.6 EGL debug support. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765
14.2.7 EGL Web application components . . . . . . . . . . . . . . . . . . . . . . . . 765
14.3 Prepare for the sample application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767
14.3.1 Install the EGL component of Rational Application Developer . . . 768
14.3.2 Enable the EGL development capability . . . . . . . . . . . . . . . . . . . . 771
14.3.3 Install DB2 Universal Database . . . . . . . . . . . . . . . . . . . . . . . . . . 773
14.3.4 Create an EGL Web Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773
14.3.5 Set up the sample database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 777
14.3.6 Configure EGL preferences for SQL database connection. . . . . . 779
14.3.7 Configure the data source. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 780
14.3.8 Configure the DB2 JDBC class path environment variables. . . . . 783
14.4 Develop the Web application using EGL. . . . . . . . . . . . . . . . . . . . . . . . 784
14.4.1 Create the EGL data parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785
14.4.2 Create and customize a page template . . . . . . . . . . . . . . . . . . . . 799
14.4.3 Create the Faces JSPs using the Web Diagram tool . . . . . . . . . . 802
14.4.4 Add EGL components to the Faces JSPs. . . . . . . . . . . . . . . . . . . 806
14.5 Import and run the sample Web application . . . . . . . . . . . . . . . . . . . . . 816
14.5.1 Import the EGL Web application sample. . . . . . . . . . . . . . . . . . . . 816
14.5.2 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816
14.5.3 Generate Java from EGL source . . . . . . . . . . . . . . . . . . . . . . . . . 817
14.5.4 Run the sample EGL Web application . . . . . . . . . . . . . . . . . . . . . 818
14.6 Considerations for exporting an EGL project . . . . . . . . . . . . . . . . . . . . 820
14.6.1 Reduce the file size of the Project Interchange file . . . . . . . . . . . . 821
14.6.2 Manually adding the runtime libraries after migration . . . . . . . . . . 822
14.6.3 Export WAR/EAR with source. . . . . . . . . . . . . . . . . . . . . . . . . . . . 823
Chapter 15. Develop Web applications using EJBs. . . . . . . . . . . . . . . . . 827
15.1 Introduction to Enterprise JavaBeans . . . . . . . . . . . . . . . . . . . . . . . . . . 828
15.1.1 What is new. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 828
15.1.2 Enterprise JavaBeans overview . . . . . . . . . . . . . . . . . . . . . . . . . . 828
15.1.3 EJB server. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 831
15.1.4 EJB container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 832
15.1.5 EJB components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 834
Contents xiii
15.2 RedBank sample application overview . . . . . . . . . . . . . . . . . . . . . . . . . 840
15.3 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 844
15.3.1 Required software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 844
15.3.2 Create and configure the EJB projects . . . . . . . . . . . . . . . . . . . . . 844
15.3.3 Create an EJB project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 845
15.3.4 Configure the EJB projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 849
15.3.5 Import BankBasicWeb Project . . . . . . . . . . . . . . . . . . . . . . . . . . . 853
15.3.6 Set up the sample database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 854
15.3.7 Configure the data source. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 856
15.4 Develop an EJB application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 858
15.4.1 Create the entity beans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 859
15.4.2 Create the entity relationships. . . . . . . . . . . . . . . . . . . . . . . . . . . . 872
15.4.3 Customize the entity beans and add business logic . . . . . . . . . . . 880
15.4.4 Creating custom finders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 890
15.4.5 Object-relational mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 892
15.4.6 Implement the session facade . . . . . . . . . . . . . . . . . . . . . . . . . . . 901
15.5 Testing EJB with the Universal Test Client . . . . . . . . . . . . . . . . . . . . . . 915
15.6 Adapting the Web application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 919
Chapter 16. Develop J2EE application clients . . . . . . . . . . . . . . . . . . . . . 925
16.1 Introduction to J2EE application clients. . . . . . . . . . . . . . . . . . . . . . . . . 926
16.2 Overview of the sample application. . . . . . . . . . . . . . . . . . . . . . . . . . . . 928
16.3 Preparing for the sample application. . . . . . . . . . . . . . . . . . . . . . . . . . . 931
16.3.1 Import the base enterprise application sample . . . . . . . . . . . . . . . 932
16.3.2 Set up the sample database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 933
16.3.3 Configure the data source. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 934
16.3.4 Test the imported code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 936
16.4 Develop the J2EE application client . . . . . . . . . . . . . . . . . . . . . . . . . . . 936
16.4.1 Create the J2EE application client projects. . . . . . . . . . . . . . . . . . 937
16.4.2 Configure the J2EE application client projects . . . . . . . . . . . . . . . 938
16.4.3 Import the graphical user interface and control classes . . . . . . . . 939
16.4.4 Create the BankDesktopController class . . . . . . . . . . . . . . . . . . . 940
16.4.5 Complete the BankDesktopController class . . . . . . . . . . . . . . . . . 942
16.4.6 Register the BankDesktopController class as the Main class. . . . 946
16.5 Test the J2EE application client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 946
16.6 Package the application client project. . . . . . . . . . . . . . . . . . . . . . . . . . 949
Chapter 17. Develop Web Services applications . . . . . . . . . . . . . . . . . . . 951
17.1 Introduction to Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 952
17.1.1 Service-oriented architecture (SOA) . . . . . . . . . . . . . . . . . . . . . . . 952
17.1.2 Web Services as an SOA implementation . . . . . . . . . . . . . . . . . . 953
17.1.3 Related Web Services standards . . . . . . . . . . . . . . . . . . . . . . . . . 955
17.2 Web Services tools in Application Developer . . . . . . . . . . . . . . . . . . . . 957
xiv Rational Application Developer V6 Programming Guide
17.2.1 Creating a Web Service from existing resources . . . . . . . . . . . . . 957
17.2.2 Creating a skeleton Web Service . . . . . . . . . . . . . . . . . . . . . . . . . 958
17.2.3 Client development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 958
17.2.4 Testing tools for Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . 959
17.3 Preparing for the samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 959
17.3.1 Import the sample code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 959
17.3.2 Enable the Web Services Development capability . . . . . . . . . . . . 960
17.3.3 Set up the sample back-end database . . . . . . . . . . . . . . . . . . . . . 961
17.3.4 Add Cloudscape JDBC driver (JAR) to the project . . . . . . . . . . . . 962
17.3.5 Define a server to test the application. . . . . . . . . . . . . . . . . . . . . . 963
17.3.6 Test the application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 963
17.4 Create a Web Service from a JavaBean . . . . . . . . . . . . . . . . . . . . . . . . 964
17.4.1 Create a Web Service using the Web Service wizard. . . . . . . . . . 964
17.4.2 Resources generated by the Web Services wizard . . . . . . . . . . . 968
17.4.3 Test the Web Service using the Web Services Explorer. . . . . . . . 971
17.4.4 Generate and test the client proxy . . . . . . . . . . . . . . . . . . . . . . . . 973
17.4.5 Monitor the Web Service using the TCP/IP Monitor . . . . . . . . . . . 976
17.5 Create a Web Service from an EJB . . . . . . . . . . . . . . . . . . . . . . . . . . . 980
17.6 Web Services security. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 980
17.7 Publish a Web Service using UDDI. . . . . . . . . . . . . . . . . . . . . . . . . . . . 982
Chapter 18. Develop portal applications. . . . . . . . . . . . . . . . . . . . . . . . . . 985
18.1 Introduction to portals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 986
18.1.1 Portal concepts and definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . 986
18.1.2 IBM WebSphere Portal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 989
18.1.3 IBM Rational Application Developer . . . . . . . . . . . . . . . . . . . . . . . 989
18.2 Developing applications for WebSphere Portal. . . . . . . . . . . . . . . . . . . 992
18.2.1 Portal samples and tutorials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 992
18.2.2 Development strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 993
18.2.3 Portal tools for developing portals. . . . . . . . . . . . . . . . . . . . . . . . . 996
18.2.4 Portal tools for developing portlets . . . . . . . . . . . . . . . . . . . . . . . 1002
18.2.5 Portal tools for testing and debugging portlets . . . . . . . . . . . . . . 1016
18.2.6 Portal tools for deploying and managing portlets . . . . . . . . . . . . 1020
18.2.7 Enterprise Application Integration Portal Tools . . . . . . . . . . . . . . 1022
18.2.8 Coexistence and migration of tools and applications . . . . . . . . . 1023
18.3 Portal development scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1025
18.3.1 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1025
18.3.2 Create a portal project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1026
18.3.3 Add and modify a portal page . . . . . . . . . . . . . . . . . . . . . . . . . . . 1027
18.3.4 Create and modify two portlets . . . . . . . . . . . . . . . . . . . . . . . . . . 1030
18.3.5 Add portlets to a portal page . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1033
18.3.6 Run the project in the test environment . . . . . . . . . . . . . . . . . . . 1037
Contents xv
Part 3. Test and debug applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1041
Chapter 19. Servers and server configuration . . . . . . . . . . . . . . . . . . . . 1043
19.1 Introduction to server configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . 1044
19.1.1 Supported test server environments . . . . . . . . . . . . . . . . . . . . . . 1045
19.1.2 Local vs. remote test environments . . . . . . . . . . . . . . . . . . . . . . 1046
19.1.3 Commands to manage test servers . . . . . . . . . . . . . . . . . . . . . . 1046
19.2 Configure a WebSphere V6 Test Environment . . . . . . . . . . . . . . . . . . 1046
19.2.1 Understanding WebSphere Application Server V6.0 profiles . . . 1047
19.2.2 WebSphere Application Server V6 installation . . . . . . . . . . . . . . 1050
19.2.3 WebSphere Application Server V6 profile creation . . . . . . . . . . . 1051
19.2.4 Define a new server in Rational Application Developer . . . . . . . 1057
19.2.5 Verify the server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1061
19.2.6 Customize a server in Rational Application Developer . . . . . . . . 1062
19.3 Add a project to a server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1064
19.3.1 Considerations for adding a project to a server . . . . . . . . . . . . . 1064
19.3.2 Add a project to a server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1065
19.4 Remove a project from a server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1066
19.4.1 Remove a project via Rational Application Developer . . . . . . . . 1066
19.4.2 Remove a project via WebSphere Administrative Console. . . . . 1067
19.5 Publish application changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1068
19.6 Configure application and server resources . . . . . . . . . . . . . . . . . . . . 1069
19.6.1 Configure application resources . . . . . . . . . . . . . . . . . . . . . . . . . 1069
19.6.2 Configure server resources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1078
19.6.3 Configure messaging resources . . . . . . . . . . . . . . . . . . . . . . . . . 1079
19.6.4 Configure security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1079
19.7 TCP/IP Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1079
Chapter 20. JUnit and component testing . . . . . . . . . . . . . . . . . . . . . . . 1081
20.1 Introduction to application testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1082
20.1.1 Test concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1082
20.1.2 Benefits of unit and component testing . . . . . . . . . . . . . . . . . . . . 1085
20.1.3 Eclipse Hyades . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1086
20.2 JUnit testing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1087
20.2.1 JUnit fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1087
20.2.2 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1089
20.2.3 Create the JUnit test case. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1089
20.2.4 Run the JUnit test case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1098
20.3 Automated component testing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1102
20.3.1 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1102
20.3.2 Create a test project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1103
20.3.3 Create a Java component test . . . . . . . . . . . . . . . . . . . . . . . . . . 1103
20.3.4 Complete the component test code . . . . . . . . . . . . . . . . . . . . . . 1107
xvi Rational Application Developer V6 Programming Guide
20.3.5 Run the component test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1110
20.4 Web application testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1112
20.4.1 Preparing for the sample. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1113
20.4.2 Create a Java project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1113
20.4.3 Create (record) a test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1113
20.4.4 Edit the test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1115
20.4.5 Generate an executable test . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1115
20.4.6 Create a deployment definition . . . . . . . . . . . . . . . . . . . . . . . . . . 1116
20.4.7 Run the test. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1117
20.4.8 Analyze the test results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1118
Chapter 21. Debug local and remote applications . . . . . . . . . . . . . . . . . 1121
21.1 Introduction to the debug tooling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1122
21.1.1 Summary of new Version 6 features . . . . . . . . . . . . . . . . . . . . . . 1122
21.1.2 Supported languages and environments . . . . . . . . . . . . . . . . . . 1124
21.1.3 General functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1124
21.1.4 Drop-to-frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1126
21.1.5 View Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1127
21.1.6 XSLT debugger. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1128
21.2 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1131
21.3 Debug a Web application on a local server. . . . . . . . . . . . . . . . . . . . . 1132
21.3.1 Set breakpoints in a servlet. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1132
21.3.2 Set breakpoints in a JSP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1135
21.3.3 Start the application for debugging . . . . . . . . . . . . . . . . . . . . . . . 1136
21.3.4 Run the application in the debugger . . . . . . . . . . . . . . . . . . . . . . 1136
21.3.5 Debug view with stack frames. . . . . . . . . . . . . . . . . . . . . . . . . . . 1141
21.3.6 Debug functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1141
21.3.7 Breakpoints view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1142
21.3.8 Watch variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1142
21.3.9 Inspect variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1143
21.3.10 Evaluate an expression. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1143
21.3.11 Debug a JSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1145
21.4 Debug a Web application on a remote server . . . . . . . . . . . . . . . . . . . 1145
21.4.1 Export the BankBasicWeb project to a WAR file. . . . . . . . . . . . . 1145
21.4.2 Deploy the BankBasicWeb.war. . . . . . . . . . . . . . . . . . . . . . . . . . 1146
21.4.3 Install the IBM Rational Agent Controller . . . . . . . . . . . . . . . . . . 1147
21.4.4 Configure debug on remote WebSphere Application Server . . . 1147
21.4.5 Attach to the remote server in Rational Application Developer. . 1148
21.4.6 Debug the application on the remote server . . . . . . . . . . . . . . . . 1151
Part 4. Deploy and profile applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1153
Chapter 22. Build applications with Ant . . . . . . . . . . . . . . . . . . . . . . . . . 1155
22.1 Introduction to Ant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1156
Contents xvii
22.1.1 Ant build files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1156
22.1.2 Ant tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1157
22.2 New features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1157
22.2.1 Code Assist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1158
22.2.2 Code snippets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1159
22.2.3 Format an Ant script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1163
22.2.4 Define format of an Ant script . . . . . . . . . . . . . . . . . . . . . . . . . . . 1164
22.2.5 Problem view. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1166
22.3 Build a simple Java application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1167
22.3.1 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1168
22.3.2 Create a build file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1169
22.3.3 Project definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1171
22.3.4 Global properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1171
22.3.5 Build targets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1171
22.3.6 Run Ant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1173
22.3.7 Ant Log Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1176
22.3.8 Rerun Ant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1177
22.3.9 Forced build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1177
22.3.10 Classpath problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1178
22.3.11 Run the sample application to verify the Ant build . . . . . . . . . . 1178
22.4 Build a J2EE application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1178
22.4.1 J2EE application deployment packaging . . . . . . . . . . . . . . . . . . 1179
22.4.2 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1179
22.4.3 Create the build script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1180
22.4.4 Run the Ant J2EE application build. . . . . . . . . . . . . . . . . . . . . . . 1183
22.5 Run Ant outside of Application Developer. . . . . . . . . . . . . . . . . . . . . . 1185
22.5.1 Prepare for the headless build . . . . . . . . . . . . . . . . . . . . . . . . . . 1186
22.5.2 Run the headless Ant build script . . . . . . . . . . . . . . . . . . . . . . . . 1187
Chapter 23. Deploy enterprise applications . . . . . . . . . . . . . . . . . . . . . . 1189
23.1 Introduction to application deployment . . . . . . . . . . . . . . . . . . . . . . . . 1190
23.1.1 Common deployment considerations . . . . . . . . . . . . . . . . . . . . . 1190
23.1.2 J2EE application components and deployment modules . . . . . . 1191
23.1.3 Java and WebSphere class loader . . . . . . . . . . . . . . . . . . . . . . . 1191
23.1.4 Deployment descriptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1196
23.1.5 WebSphere deployment architecture . . . . . . . . . . . . . . . . . . . . . 1199
23.2 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1212
23.2.1 Review the deployment scenarios . . . . . . . . . . . . . . . . . . . . . . . 1213
23.2.2 Install prerequisite software . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1213
23.2.3 Import the sample application Project Interchange file . . . . . . . . 1214
23.2.4 Set up the sample database . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1215
23.3 Package the application for deployment . . . . . . . . . . . . . . . . . . . . . . . 1218
23.3.1 Packaging recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . 1218
xviii Rational Application Developer V6 Programming Guide
23.3.2 Generate the EJB to RDB mapping . . . . . . . . . . . . . . . . . . . . . . 1218
23.3.3 Customize the deployment descriptors . . . . . . . . . . . . . . . . . . . . 1220
23.3.4 Remove the Enhanced EAR datasource . . . . . . . . . . . . . . . . . . 1221
23.3.5 Generate the deploy code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1222
23.3.6 Export the EAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1222
23.4 Deploy the enterprise application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1224
23.4.1 Configure the data source in WebSphere Application Server. . . 1225
23.4.2 Deploy the EAR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1229
23.5 Verify the application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1230
Chapter 24. Profile applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1237
24.1 Introduction to profiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1238
24.1.1 Profiling features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1238
24.1.2 Profiling architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1242
24.1.3 Profiling and Logging perspective . . . . . . . . . . . . . . . . . . . . . . . . 1244
24.1.4 Profiling sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1245
24.2 Prepare for the profiling sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1246
24.2.1 Prerequisites hardware and software . . . . . . . . . . . . . . . . . . . . . 1247
24.2.2 Enable the Profiling and Logging capability . . . . . . . . . . . . . . . . 1247
24.2.3 Import the sample project interchange file . . . . . . . . . . . . . . . . . 1248
24.2.4 Publish and run sample application . . . . . . . . . . . . . . . . . . . . . . 1249
24.3 Profile the sample application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1249
24.3.1 Start server in profile mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1249
24.3.2 Collect profile information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1253
24.3.3 Analysis of code coverage information . . . . . . . . . . . . . . . . . . . . 1253
Part 5. Team development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1255
Chapter 25. Rational ClearCase integration . . . . . . . . . . . . . . . . . . . . . . 1257
25.1 Introduction to IBM Rational ClearCase . . . . . . . . . . . . . . . . . . . . . . . 1258
25.1.1 IBM Rational Application Developer ClearCase overview . . . . . 1258
25.1.2 IBM Rational ClearCase terminology . . . . . . . . . . . . . . . . . . . . . 1259
25.1.3 IBM Rational ClearCase LT installation . . . . . . . . . . . . . . . . . . . 1260
25.1.4 IBM Rational Application Developer integration for ClearCase. . 1260
25.2 Integration scenario overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1263
25.3 ClearCase setup for a new project . . . . . . . . . . . . . . . . . . . . . . . . . . . 1264
25.3.1 Enable Team capability in preferences . . . . . . . . . . . . . . . . . . . . 1264
25.3.2 Create new ClearCase project . . . . . . . . . . . . . . . . . . . . . . . . . . 1265
25.3.3 Join a ClearCase project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1268
25.3.4 Create a Web project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1274
25.3.5 Add a project to ClearCase source control . . . . . . . . . . . . . . . . . 1274
25.4 Development scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1277
25.4.1 Developer 1 adds a servlet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1277
25.4.2 Developer 1 delivers work to the integration stream . . . . . . . . . . 1279
Contents xix
25.4.3 Developer 1 makes a baseline . . . . . . . . . . . . . . . . . . . . . . . . . . 1282
25.4.4 Developer 2 joins the project. . . . . . . . . . . . . . . . . . . . . . . . . . . . 1284
25.4.5 Developer 2 imports projects into Application Developer . . . . . . 1287
25.4.6 Developer 2 modifies the servlet. . . . . . . . . . . . . . . . . . . . . . . . . 1289
25.4.7 Developer 2 delivers work to the integration stream . . . . . . . . . . 1292
25.4.8 Developer 1 modifies the servlet. . . . . . . . . . . . . . . . . . . . . . . . . 1293
25.4.9 Developer 1 delivers new work to the integration stream . . . . . . 1294
Chapter 26. CVS integration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1299
26.1 Introduction to CVS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1300
26.1.1 CVS features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1300
26.1.2 New V6 features for team development . . . . . . . . . . . . . . . . . . . 1301
26.2 CVSNT Server implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1301
26.2.1 CVS Server installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1302
26.2.2 CVS Server repository configuration. . . . . . . . . . . . . . . . . . . . . . 1303
26.2.3 Create the Windows users and groups used by CVS . . . . . . . . . 1306
26.2.4 Verify the CVSNT installation . . . . . . . . . . . . . . . . . . . . . . . . . . . 1307
26.2.5 Create CVS users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1307
26.3 CVS client configuration for Application Developer. . . . . . . . . . . . . . . 1309
26.3.1 Configure CVS Team Capabilities . . . . . . . . . . . . . . . . . . . . . . . 1309
26.3.2 Access the CVS Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1310
26.4 Configure CVS in Rational Application Developer . . . . . . . . . . . . . . . 1312
26.4.1 Configure Rational Application Developer CVS preferences . . . 1312
26.5 Development scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1321
26.5.1 Create and share the project (step 1 - cvsuser1) . . . . . . . . . . . . 1322
26.5.2 Add a shared project to the workspace (step 2 - cvsuser2) . . . . 1327
26.5.3 Modifying the Servlet (step 2 - cvsuser1) . . . . . . . . . . . . . . . . . . 1332
26.5.4 Synchronize with repository (step 3 - cvsuser1) . . . . . . . . . . . . . 1333
26.5.5 Parallel development (step 4 - cvsuser1 and cvsuser2) . . . . . . . 1335
26.5.6 Versioning (step 5- cvsuser1) . . . . . . . . . . . . . . . . . . . . . . . . . . . 1342
26.6 CVS resource history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1343
26.7 Comparisons in CVS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1344
26.7.1 Comparing workspace file with repository. . . . . . . . . . . . . . . . . . 1345
26.7.2 Comparing two revisions in repository . . . . . . . . . . . . . . . . . . . . 1347
26.8 Annotations in CVS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1348
26.9 Branches in CVS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1350
26.9.1 Branching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1350
26.9.2 Merging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1354
26.9.3 Refreshing server-defined branches . . . . . . . . . . . . . . . . . . . . . . 1357
26.10 Work with patches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1360
26.11 Disconnecting a project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1360
26.12 Synchronize perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1361
26.12.1 Custom configuration of resource synchronization . . . . . . . . . . 1362
xx Rational Application Developer V6 Programming Guide
26.12.2 Schedule synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1367
Part 6. Appendixes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1369
Appendix A. IBM product installation and configuration tips. . . . . . . . 1371
IBM Rational Application Developer V6 installation . . . . . . . . . . . . . . . . . . . 1372
Rational Application Developer installation . . . . . . . . . . . . . . . . . . . . . . . 1372
WebSphere Portal V5.0 Test Environment installation . . . . . . . . . . . . . . 1376
WebSphere Portal V5.1 Test Environment installation . . . . . . . . . . . . . . 1377
Rational Application Developer Product Updater - Interim Fix 0004. . . . 1380
IBM Rational Agent Controller V6 installation . . . . . . . . . . . . . . . . . . . . . . . 1382
IBM Rational ClearCase LT installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1385
IBM DB2 Universal Database V8.2 installation . . . . . . . . . . . . . . . . . . . . . . 1387
IBM WebSphere Application Server V6 installation . . . . . . . . . . . . . . . . . . . 1387
WebSphere Application Server messaging configuration . . . . . . . . . . . . . . 1389
Configure the service bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1390
Configure the bus members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1390
Configure the destinations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1390
Verify the messaging engine startup. . . . . . . . . . . . . . . . . . . . . . . . . . . . 1391
Configure JMS connection queue factory . . . . . . . . . . . . . . . . . . . . . . . . 1391
Configure the destination JMS queue . . . . . . . . . . . . . . . . . . . . . . . . . . . 1392
Configuration of a JMS activation specification. . . . . . . . . . . . . . . . . . . . 1392
Appendix B. Additional material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1395
Locating the Web material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1396
System requirements for downloading the Web material . . . . . . . . . . . . 1396
Unpack the 6449code.zip. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1396
Description of sample code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1396
Import sample code from a Project Interchange file. . . . . . . . . . . . . . . . . . . 1398
Related publications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1401
IBM Redbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1401
Other publications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1402
Online resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1402
How to get IBM Redbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1404
Help from IBM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1404
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1405
© Copyright IBM Corp. 2005. All rights reserved. xxi
Notices
This information was developed for products and services offered in the U.S.A.
IBM may not offer the products, services, or features discussed in this document in other countries. Consult
your local IBM representative for information on the products and services currently available in your area.
Any reference to an IBM product, program, or service is not intended to state or imply that only that IBM
product, program, or service may be used. Any functionally equivalent product, program, or service that
does not infringe any IBM intellectual property right may be used instead. However, it is the user's
responsibility to evaluate and verify the operation of any non-IBM product, program, or service.
IBM may have patents or pending patent applications covering subject matter described in this document.
The furnishing of this document does not give you any license to these patents. You can send license
inquiries, in writing, to:
IBM Director of Licensing, IBM Corporation, North Castle Drive Armonk, NY 10504-1785 U.S.A.
The following paragraph does not apply to the United Kingdom or any other country where such provisions
are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES
THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT,
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer
of express or implied warranties in certain transactions, therefore, this statement may not apply to you.
This information could include technical inaccuracies or typographical errors. Changes are periodically made
to the information herein; these changes will be incorporated in new editions of the publication. IBM may
make improvements and/or changes in the product(s) and/or the program(s) described in this publication at
any time without notice.
Any references in this information to non-IBM Web sites are provided for convenience only and do not in any
manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of the
materials for this IBM product and use of those Web sites is at your own risk.
IBM may use or distribute any of the information you supply in any way it believes appropriate without
incurring any obligation to you.
Information concerning non-IBM products was obtained from the suppliers of those products, their published
announcements or other publicly available sources. IBM has not tested those products and cannot confirm
the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on
the capabilities of non-IBM products should be addressed to the suppliers of those products.
This information contains examples of data and reports used in daily business operations. To illustrate them
as completely as possible, the examples include the names of individuals, companies, brands, and products.
All of these names are fictitious and any similarity to the names and addresses used by an actual business
enterprise is entirely coincidental.
COPYRIGHT LICENSE:
This information contains sample application programs in source language, which illustrates programming
techniques on various operating platforms. You may copy, modify, and distribute these sample programs in
any form without payment to IBM, for the purposes of developing, using, marketing or distributing application
programs conforming to the application programming interface for the operating platform for which the
sample programs are written. These examples have not been thoroughly tested under all conditions. IBM,
therefore, cannot guarantee or imply reliability, serviceability, or function of these programs. You may copy,
modify, and distribute these sample programs in any form without payment to IBM for the purposes of
developing, using, marketing, or distributing application programs conforming to IBM's application
programming interfaces.
xxii Rational Application Developer V6 Programming Guide
Trademarks
The following terms are trademarks of the International Business Machines Corporation in the United States,
other countries, or both:
AIX®
Balance®
ClearCase MultiSite®
ClearCase®
Cloudscape™
DB2 Universal Database™
DB2®
developerWorks®
Informix®
IBM®
ibm.com®
IMS™
iSeries™
Lotus Notes®
Lotus®
Notes®
OS/390®
OS/400®
Rational Rose®
Rational Unified Process®
Rational®
Redbooks™
Redbooks (logo) ™
RUP®
S/390®
ThinkCentre™
VisualAge®
VisualGen®
WebSphere®
Workplace™
Workplace Web Content
Management™
XDE™
z/OS®
zSeries®
The following terms are trademarks of other companies:
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.
Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the
United States, other countries, or both.
Intel, Intel Inside (logos), MMX, and Pentium are trademarks of Intel Corporation in the United States, other
countries, or both.
UNIX is a registered trademark of The Open Group in the United States and other countries.
Linux is a trademark of Linus Torvalds in the United States, other countries, or both.
Other company, product, and service names may be trademarks or service marks of others.
© Copyright IBM Corp. 2005. All rights reserved. xxiii
Preface
IBM® Rational® Application Developer V6.0 is the full function Eclipse 3.0 based
development platform for developing Java™ 2 Platform Standard Edition (J2SE)
and Java 2 Platform Enterprise Edition (J2EE) applications with a focus on
applications to be deployed to IBM WebSphere® Application Server and IBM
WebSphere Portal. Rational Application Developer provides integrated
development tools for all development roles, including Web developers, Java
developers, business analysts, architects, and enterprise programmers.
This IBM Redbook is a programming guide that highlights the features and
tooling included with IBM Rational Application Developer V6.0. Many of the
chapters provide working examples that demonstrate how to use the tooling to
develop applications as well as achieve the benefits of visual and rapid Web
development.
This book consists of six parts:
򐂰 Introduction to Rational Application Developer
򐂰 Develop applications
򐂰 Test and debug applications
򐂰 Deploy and profile applications
򐂰 Team development
򐂰 Appendixes
The team that wrote this redbook
This redbook was produced by a team of specialists from around the world
working at the International Technical Support Organization, Raleigh Center.
xxiv Rational Application Developer V6 Programming Guide
Figure 1 IBM Redbook team (top, l-r: Neil Weightman, Fabio Ferraz, Richard Raszka, Juha Nevalainen;
bottom, l-r: Hari Kanangi, John Ganci, Nicolai Nielsen, Kiriya Keat)
John Ganci is a Consulting IT Specialist at the IBM ITSO, Raleigh Center, USA.
John has 15 years of experience in application design, development, testing, and
consulting. His areas of expertise include e-business integration, WebSphere
Application Server, e-commerce, portals, pervasive computing, technical team
leadership, Linux®, and J2EE programming.
Daniel Farrell is a Certified Specialist in the IBM Software Group USA. He has a
Masters degree in Computer Science from Regis University and is currently
pursuing a PhD from Clemson in Adult Education and Human Resource Studies.
He has 20 years of experience working with Informix® and related database
technologies, and more recently has been focusing on IBM EGL and supporting
tooling.
Preface xxv
Fabio Ferraz is the Chief Consultant for Advus Corp, São Paulo, Brazil. He has
12 years of experience in the IT field, with eight of those dedicated to e-business.
Ed Gondek is a Product Manager in the USA with IBM Software Group -
Rational products division. He has 25 years of Information Systems and software
management experience with expertise in 4GLs, Web-based application design,
Web analytics, business intelligence tooling, and software product delivery.
Hari Kanangi is a Senior Technical Consultant for Stratus Solutions, Inc. He has
nine years of industry experience. Over the past six years, Hari has focused on
WebSphere, J2EE, and Java-based technologies. His expertise includes
architecting, designing, developing, and deploying J2EE-based solutions. He is a
Sun-certified Java Programmer, architect, and a WebSphere-certified specialist.
Kiriya Keat is an IT Specialist in Australia with IBM Global Services. He has five
years of experience in the Web development field. His areas of expertise include
e-business integration, application architecture and development, technical team
leadership, and WebSphere solutions.
George Kroner is a Co-op IT Specialist at the IBM ITSO Center in Raleigh,
North Carolina. He is currently pursuing a Bachelor of Science degree in
Information Sciences and Technology at Pennsylvania State University. His
interests include Web applications, wireless/mobile computing, and intelligent
interfaces.
Juha Nevalainen is an Consulting IT Specialist for Rational Technical Sales with
IBM Finland. His areas of expertise include Rational brand software products,
WebSphere Commerce, e-business, and systems integration.
Nicolai Nielsen is an Advisory IT Specialist with IBM Global Services, Denmark.
He has nine years of experience in the fields of consulting, application
development, and systems integration. Nicolai holds a degree in engineering
from the Technical University of Denmark. He has written extensively about
WebSphere Commerce, J2EE application development, and has worked on
several WebSphere Commerce projects over the last three years.
Richard Raszka is a Senior IT Specialist in IBM Global Services, Application
Management Services, Australia. He has 19 years of IT experience in the fields
of application development, systems integration (particularly of
e-business/e-commerce solutions), project planning, compiler development,
configuration management, graphics and CAD/CAM development, simulation,
and agent-oriented artificial intelligence. He holds degrees in Mechanical
Engineering, Mathematical and Computer Science from the University of
Adelaide and a Masters of Technology Management from Monash University in
Melbourne. His areas of expertise include end-to-end systems integration,
application design including patterns, application architecture, and development,
xxvi Rational Application Developer V6 Programming Guide
technical team leadership, e-business solutions, WebSphere Application Server,
UNIX®, J2EE architecture, and Java development.
Neil Weightman is a Technical Instructor in the United Kingdom. He has 15
years of experience in the software development field. He holds a degree in
Physics from Imperial College, University of London, and a masters in Scientific
Computing from South Bank University, London. His areas of expertise include
J2EE component development, Web services development, and best practices.
Thanks to the following people for their contributions to this project:
򐂰 Ueli Wahli, Ian Brown, Fabio Ferraz, Maik Schumacher, Henrik Sjostrand who
wrote the previous redbook edition, WebSphere Studio Application Developer
Version 5 Programming Guide, SG24-6957
򐂰 Special thanks to Eric Erpenbach from the IBM WebSphere Technology and
Training organization for providing early training materials on IBM Rational
Application Developer V6.0, which was a tremendous help in ramping up on
the new features for many topics found in this book
򐂰 Beverly DeWitt, Rational Application Developer Product Manager, IBM
Toronto, Canada
򐂰 Geni Hutton, Rational Application Developer Product Manager, IBM Toronto,
Canada
򐂰 Todd Britton, Manager for IBM Rational Application Developer Tools
Development, IBM Raleigh, USA
򐂰 Kate Price, Rational Application Developer Information Development, IBM
Toronto, Canada
򐂰 Leigh Davidson, Rational Application Developer Information Development
Editor, IBM Toronto, Canada
򐂰 Tim Deboer, IBM WebSphere Tools, IBM Toronto, Canada
򐂰 Prem Lall, IT Specialist for IBM Global Services, IBM Gaithersburg, USA
򐂰 Chris Feldhacker, Principal Financial Group
Become a published author
Join us for a two- to six-week residency program! Help write an IBM Redbook
dealing with specific products or solutions, while getting hands-on experience
with leading-edge technologies. You'll team with IBM technical professionals,
Business Partners and/or customers.
Preface xxvii
Your efforts will help increase product acceptance and customer satisfaction. As
a bonus, you'll develop a network of contacts in IBM development labs, and
increase your productivity and marketability.
Find out more about the residency program, browse the residency index, and
apply online at:
ibm.com/redbooks/residencies.html
Comments welcome
Your comments are important to us!
We want our Redbooks™ to be as helpful as possible. Send us your comments
about this or other Redbooks in one of the following ways:
򐂰 Use the online Contact us review redbook form found at:
ibm.com/redbooks
򐂰 Send your comments in an email to:
redbook@us.ibm.com
򐂰 Mail your comments to:
IBM Corporation, International Technical Support Organization
Dept. HZ8 Building 662
P.O. Box 12195
Research Triangle Park, NC 27709-2195
Summary of changes
This section describes the technical changes made in this edition of the book and
in previous editions. This edition may also include minor corrections and editorial
changes that are not identified.
Summary of Changes
for SG24-6449-00
for the Rational Application Developer V6 Programming Guide
June 2005, First Edition
This book is a major rewrite ofWebSphere Studio Application Developer Version
5 Programming Guide, SG24-6957. The previous book was based on Application
Developer Version 5; this book is based on Version 6.
xxviii Rational Application Developer V6 Programming Guide
This revision reflects the addition, deletion, or modification of new and changed
information described below.
New information
򐂰 Broaden appeal
– Improves user assistance and ease of learning
– Progressive disclosure of tools
򐂰 Raise productivity
– Rapid Web and Portal application development
– Rapid deployment to WebSphere Application Server V6.0
򐂰 Extended integration
– Integration of Rational technology to enhance the application development
lifecycle and raise productivity
– Enhance portal as a first-class deployment target
򐂰 Maintain standards and middleware support
– Java 2 Platform Enterprise Edition V1.4 specification compliance
– Support for many new integrated test servers including WebSphere
Application Server V6.0/V5.x, and WebSphere Portal V5.0.2.2
– New and enhanced tooling (Web Services, EGL, Visual UML, portal,
Struts, JSF, SDO, etc.).
Changed information
򐂰 General update of existing information to Version 6
Deleted information
򐂰 Developing Web applications with database access using DB beans. The
preferred method of database access is Service Data Objects (SDO).
© Copyright IBM Corp. 2005. All rights reserved. 1
Part 1 Introduction to
Rational
Application
Developer
Part 1
2 Rational Application Developer V6 Programming Guide
© Copyright IBM Corp. 2005. All rights reserved. 3
Chapter 1. Introduction
IBM Rational Application Developer V6.0 is the full function development
platform for developing Java 2 Platform Standard Edition (J2SE) and Java 2
Platform Enterprise Edition (J2EE) applications with a focus on applications to be
deployed to IBM WebSphere Application Server and IBM WebSphere Portal.
This chapter contains an introduction to the concepts, packaging, and features of
IBM Rational Application Developer V6.0 and IBM Rational Web Developer V6.0
products.
The chapter is organized into the following sections:
򐂰 Introduction and concepts
򐂰 Product packaging
򐂰 Product features
򐂰 Sample code
1
Note: Although this chapter does contain information on both IBM Rational
Application Developer V6.0 and IBM Rational Web Developer V6.0, the
majority of the chapters and samples found in this book were only tested with
IBM Rational Application Developer V6.0.
4 Rational Application Developer V6 Programming Guide
1.1 Introduction and concepts
This section provides an introduction to the Rational Software Development
Platform, Eclipse, Rational Application Developer, and Rational Web Developer.
Rational products help your business or organization manage the entire software
development process. Software modelers, architects, developers, and testers
can use the same team-unifying Rational Software Development Platform tooling
to be more efficient in exchanging assets, following common processes,
managing change and requirements, maintaining status, and improving quality.
1.1.1 IBM Rational Software Development Platform
The IBM Rational Software Development Platform is not a single product, but
rather an integrated set of products that share a common technology platform
built on the Eclipse 3.0 framework in support of each phase of the development
life cycle.
The IBM Rational Software Development Platform provides a team-based
environment with capabilities that are optimized for the key roles of a
development team including business analyst, architect, developer, tester, and
deployment manager. It enables a high degree of team cohesion through shared
access to common requirements, test results, software assets, and workflow and
process guidance. Combined, these capabilities improve both individual and
team productivity.
Figure 1-1 on page 5 provides perspective on how the Rational Application
Developer and Rational Web Developer products fit within the IBM Rational
Software Development Platform product set.
Chapter 1. Introduction 5
Figure 1-1 Rational Software Development Platform products
We have included a brief description of each of the products included in the IBM
Rational Software Development Platform (see Figure 1-1) that share common
tooling based on the IBM Eclipse SDK V3.0 (IBM-supported Eclipse 3.0):
򐂰 Rational Software Modeler
The Software Modeler is a UML-based visual modeling and design tool for
system analysts, software architects, and designers who need to clearly
define and communicate their architectural specifications to stakeholders.
This product was known in previous releases as Rational XDE™ Modeler and
is targeted at development shops where the business analyst has a distinct
role of architecture and design (no development).
򐂰 Rational Software Architect
The Software Architect is a design and construction tool that leverages
model-driven development with UML for creating well-architected
applications, including those based on a Service Oriented Architecture
(SOA). It unifies modeling, Java structural review, Web Services, J2SE,
J2EE, database, XML, Web development, and process guidance for
architects and senior developers creating applications in Java or C++.
This product was known in previous releases as Rational Rose® and Rational
XDE for Java. Software Architect includes architecture and design capability
as well as full J2EE development functionality provided by Rational
Application Developer. This product is targeted at development shops where
Rational SoftwareDevelopment Platform(IBMEclipse SDK3.0)
WebSphere
Business
Integrator
Modeler
Rational
Web
Developer
Rational
Application
Developer
Rational
Software
Architect
Rational
Software
Modeler
Rational
Function
Tester
Rational
Performance
Tester
Analyst Architect / Application Developer Tester
Rational
Manual
Tester
6 Rational Application Developer V6 Programming Guide
the architect has a strong architecture and design role, as well as application
development. If architects only need the modeling functionality, they should
use the Rational Software Modeler product.
򐂰 Rational Web Developer
The IBM Rational Web Developer (or simply Web Developer) extends the
capabilities of Eclipse 3.0 with visual tools for Web, Java, and rich client
applications, and full support for XML, Web services, and Enterprise
Generation Language.
In previous releases this product was known as WebSphere Studio Site
Developer. Rational Web Developer is packaged with IBM WebSphere
Application Server Express V6.0.
򐂰 Rational Application Developer
The IBM Rational Application Developer is a full suite of development,
analysis, and deployment tools for rapidly implementing J2EE applications,
Enterprise JavaBeans, portlets, and Web applications.
In previous releases this product was known as WebSphere Studio
Application Developer and is targeted at J2EE developers.
򐂰 Rational Functional Tester
The Rational Function Tester is an automated testing tool that tests Java,
HTML, VB.NET, and Windows® applications. It provides the capability to
record robust scripts that can be played back to validate new builds of an
application.
򐂰 Rational Performance Tester
The Rational Performance Tester is a multi-user system performance test
product designed to test Web applications, and focuses on ease-of-use and
scalability.
򐂰 WebSphere Business Integrator Modeler
The WebSphere Business Integrator Modeler does not carry the Rational
brand name, but is an important product of the Rational Software
Development Platform. WebSphere Business Integrator Modeler targets the
business analyst who models business processes. WebSphere Business
Integrator Modeler can be used to generate Business Process Execution
Language (BPEL) definitions to be deployed to WebSphere Business
Integrator production environments. The WebSphere Business Integrator
Modeler BPEL provides a more seamless move to production and eliminates
the need to create Visio diagrams and then move to production.
Note: IBM Rational Application Developer V6.0 is the focus of this book.
Chapter 1. Introduction 7
1.1.2 Version 6 terminology
Table 1-1 provides a basic terminology comparison from Version 6 and Version 5
for reference purposes.
Table 1-1 Terminology
1.1.3 Application development challenges
To better grasp the business value that IBM Rational Application Developer V6.0
provides, it is important to understand the challenges businesses face in
application development.
Table 1-2 highlights the key application development challenges as well as
desired development tooling solutions.
Table 1-2 Application development challenges
Version 6 Version 5
Rational Developer
Note: Used to describe development
products built on common Eclipse base
WebSphere Studio
Rational Application Developer
(known as Application Developer)
WebSphere Studio Application Developer
Rational Web Developer
(known as Web Developer)
WebSphere Studio Site Developer
IBM Eclipse SDK 3.0
Note: IBM branded and value-added
version of Eclipse SDK 3.0
WebSphere Studio Workbench
(IBM supported Eclipse 2.x)
Workbench Workbench
IBM Rational Software Development
Platform
Note: Used to describe product set built
on common Eclipse 3.0 platform
N/A
Challenges Solution tooling
Application development is complex, time
consuming, and error prone.
Raise productivity by automating time
consuming and error prone tasks.
Highly skilled developers are required and
in short supply.
Improve code quality early in the
development life cycle.
8 Rational Application Developer V6 Programming Guide
1.1.4 Key themes of Version 6
There are many very significant enhancements and features in IBM Rational
Application Developer V6.0. We have listed the key themes of Version 6 tooling:
򐂰 Broaden appeal.
– Improves user assistance and ease of learning
– Progressive disclosure of tools
򐂰 Raise productivity.
– Rapid Web and Portal application development
– Rapid deployment to WebSphere Application Server and WebSphere
Portal
򐂰 Extended integration.
– Integration of Rational technology to enhance the application development
life cycle and raise productivity
– Enhances portal as a first-class deployment target
򐂰 Maintain standards and middleware support.
– Java 2 Platform Enterprise Edition V1.4 specification compliance
– Support for many new integrated test servers including WebSphere
Application Server V6.0/V5.x and WebSphere Portal V5.0.2.2/5.1
– New and enhanced tooling (Web Services, EGL, Visual UML, portal, etc.)
򐂰 Team unifying platform.
As described in “IBM Rational Software Development Platform” on page 4,
Rational Application Developer and Rational Web Developer are products
included in the IBM Rational Software Development Platform product set that
promote team development.
We provide more detail on the these new features in “Summary of new features
in Version 6” on page 14, as well as throughout the chapters of this book.
Learning curves are long. Shorten learning curves by providing
Rapid Application Development (RAD)
tooling (visual layout and design,
resusable components, code generators,
etc.).
Challenges Solution tooling
Chapter 1. Introduction 9
1.2 Product packaging
This section highlights the product packaging for IBM Rational Web Developer
V6.0 and IBM Rational Application Developer V6.0.
1.2.1 Rational Developer supported platforms and databases
This section describes the platforms and databases supported by the Rational
Developer products.
Supported operating system platforms
IBM Rational Application Developer V6.0 supports the following operating
systems:
򐂰 Microsoft® Windows:
– Windows XP with Service Packs 1 and 2
– Windows 2000 Professional with Service Packs 3 and 4
– Windows 2000 Server with Service Packs 3 and 4
– Windows 2000 Advanced Server with Service Packs 3 and 4
– Windows Server 2003 Standard Edition
– Windows Server 2003 Enterprise Edition
򐂰 Linux on Intel®:
– Red Hat Enterprise Linux Workstation V3 (all service packs)
– SuSE Linux Enterprise Server (SLES) V9 (all service packs)
The IBM Rational Agent Controller included with IBM Rational Application
Developer V6.0 is supported on many platforms running WebSphere Application
Server. For details refer to the Installation Guide, IBM Rational Application
Developer V6.0 product guide (install.html) found on the IBM Rational
Application Developer V6 Setup CD 1.
Supported databases
IBM Rational Application Developer V6.0 supports the following database
products:
򐂰 IBM Cloudscape™ V5.0
򐂰 IBM Cloudscape V5.1 (bundled with the WebSphere Application Server V6.0
Test Environment)
򐂰 IBM DB2 Universal Database V8.1
򐂰 IBM DB2 Universal Database V8.2
򐂰 IBM DB2 Universal Database Express V8.1
򐂰 IBM DB2 Universal Database Express V8.2
򐂰 IBM DB2 Universal Database for iSeries™ V4R5
򐂰 IBM DB2 Universal Database for iSeries V5R1
10 Rational Application Developer V6 Programming Guide
򐂰 IBM DB2 Universal Database for iSeries V5R2
򐂰 IBM DB2 Universal Database for iSeries V5R3
򐂰 IBM DB2 Universal Database for z/OS® and OS/390® V7
򐂰 IBM DB2 Universal Database for z/OS V8
򐂰 Informix Dynamic Server V7.3
򐂰 Informix Dynamic Server V9.2
򐂰 Informix Dynamic Server V9.3
򐂰 Informix Dynamic Server V9.4
򐂰 Microsoft SQL Server V7.0
򐂰 Microsoft SQL Server 2000
򐂰 Oracle8i V8.1.7
򐂰 Oracle9i
򐂰 Oracle10g
򐂰 Sybase Adaptive Server Enterprise V12
򐂰 Sybase Adaptive Server Enterprise V12.5
1.2.2 Rational Application Developer V6 product packaging
Table 1-3 lists the software CDs included with IBM Rational Application
Developer V6.0.
Table 1-3 IBM Rational Application Developer V6.0 product packaging
CDs Windows Linux
IBM Rational Application Developer V6.0 - Core installation files (required) X X
IBM WebSphere Application Server V6.0 Integrated Test Environment X X
IBM WebSphere Application Server V5.0.2/V5.1 Integrated Test Environment X X
IBM Enterprise Generation Language (EGL) X X
IBM Rational Application Developer V6.0 - Language Pack X X
IBM WebSphere Portal V5.0.2.2 Integrated Test Environment
Note: IBM WebSphere Portal V5.1 Test Environment is installed via its own
installer on a separate CD packaged with Rational Application Developer.
X N/A
Chapter 1. Introduction 11
1.2.3 Rational Web Developer V6 product packaging
Table 1-4 lists the software CDs included with IBM Rational Web Developer V6.0.
Table 1-4 IBM Rational Web Developer V6.0 product packaging
IBM WebSphere Portal V5.1 Test Environment
The following CDs are included for the WebSphere Portal V5.1 Test Environment
(separate installer from Rational Application Developer):
򐂰 IBM WebSphere Portal V5.1 - Portal Install (Setup) CD
򐂰 IBM WebSphere Portal V5.1 - WebSphere Business Integrator Server
Foundation (1-1) CD
򐂰 IBM WebSphere Portal V5.1 - WebSphere Business Integrator Server
Foundation (1-2) CD
򐂰 IBM WebSphere Portal V5.1 - WebSphere Business Integrator Server
Foundation WebSphere Application Server V5.1 Fixpack 1 (1-15) CD
򐂰 IBM WebSphere Portal V5.1 - Portal Server (2) CD
򐂰 IBM WebSphere Portal V5.1 - Lotus® Workplace™ Web Content
Management (3) CD
X X
IBM Rational Agent Controller
Note: Support for many additional platforms
X X
IBM WebSphere Application Server V5 - Embedded messaging client and server X X
IBM Rational ClearCase® LT
Note: Web download
Web Web
Crystal Enterprise V10 Professional Edition X X
Crystal Enterprise V10 Embedded Edition X na
IBM DB2 Universal Database V8.2, Express Edition X X
IBM WebSphere Application Server for Developers V6.0
(IBM HTTP Server, Web server plug-ins, DataDirect JDBC drivers, Appl. Clients)
X X
CDs Windows Linux
CD title Windows Linux
IBM Rational Web Developer V6.0 - Core installation files (required) X X
IBM WebSphere Application Server V6.0 Integrated Test Environment X X
IBM WebSphere Application Server V5.0.2 and V5.1 Integrated Test
Environment
X X
IBM Enterprise Generation Language (EGL) X X
IBM Rational Web Developer V6.0 - Language Pack X X
12 Rational Application Developer V6 Programming Guide
1.3 Product features
This section provides a summary of the new features of IBM Rational Application
Developer V6.0 and IBM Rational Web Developer V6.0. We will provide more
detailed information on the new features throughout the chapters of this book.
Figure 1-2 on page 13 displays a summary of features found in the IBM Rational
Developer V6.0 products. We have organized the description of the product
features into the following topics:
򐂰 Summary of new features in Version 6
򐂰 Specification versions
򐂰 Eclipse and IBM Rational Software Development Platform
򐂰 Test server environments
򐂰 Licensing and installation
򐂰 Migration and coexistence
򐂰 Tools
IBM Rational Agent Controller
Note: Support for many additional platforms
X X
IBM DB2 Universal Database V8.2, Express Edition X X
IBM WebSphere Application Server for Developers V6.0
(IBM HTTP Server, Web server plug-ins, DataDirect JDBC drivers, Appl. Clients)
X X
CD title Windows Linux
Chapter 1. Introduction 13
Figure 1-2 Tools and features summary
Figure 1-3 provides a summary of technologies supported by Rational
Application Developer categorized by the applications component.
Figure 1-3 Supported technologies for developing applications
IB
ME
c
lip
s
eS
D
K3
.0
•IB
Mc
o
m
m
e
rc
ia
llys
u
p
p
o
rte
dE
c
lip
s
e3
.0
•IB
MR
a
tio
n
a
lS
o
ftw
a
reD
e
v
e
lo
p
m
e
n
tP
la
tfo
rmto
o
lin
g
A
p
p
lic
a
tio
nS
e
rv
e
rT
o
o
l (A
S
T
)
IB
MR
a
tio
n
a
l W
e
bD
e
v
e
lo
p
e
r
IB
MR
a
tio
n
a
l A
p
p
lic
a
tio
nD
e
v
e
lo
p
e
r
•T
o
o
lfo
ra
s
s
e
m
b
ly
,d
e
p
lo
y
m
e
n
t(E
J
B
,W
e
bS
e
rv
ic
e
s
)
a
n
dd
e
b
u
gJ
2
E
Ea
p
p
lic
a
tio
n
s
•N
od
e
v
e
lo
p
m
e
n
ts
u
p
p
o
rt
•W
e
b
S
p
h
e
reR
a
p
idD
e
p
lo
y
m
e
n
t
•S
u
p
p
o
rtfo
rE
n
a
h
a
n
c
e
dE
A
R
•S
e
rv
e
rT
o
o
ls–s
u
p
p
o
rtfo
rre
m
o
tes
e
rv
e
r
•F
u
ll d
e
v
e
lo
p
m
e
n
ts
u
p
p
o
rt
•S
u
p
p
o
rtfo
rJ
2
E
E1
.2
,1
.3
,1
.4W
e
bb
a
s
e
d
a
p
p
lic
a
tio
n
s(J
S
F
,S
tru
ts
,S
D
Oto
o
ls
)
•N
oE
J
B
,J
2
Cd
e
v
e
lo
p
m
e
n
ts
u
p
p
o
rt
•S
e
rv
e
rT
e
s
tE
n
v
iro
n
m
e
n
ts(W
e
b
S
p
h
e
re
A
p
p
lic
a
tio
nS
e
rv
e
rV
5
.0
,5
.1
,6
.0
,T
o
m
c
a
t
5
.0a
n
dW
e
b
L
o
g
ic6
.1
,7
.1
,8
.1a
v
a
ila
b
le
s
e
p
a
ra
te
ly
)
•V
is
u
a
l J
a
v
aG
U
Ib
u
ild
e
r
•W
e
bD
ia
g
ra
mE
d
ito
r
•S
iteD
e
s
ig
n
e
r
•P
a
g
eT
e
m
p
la
te
s
•X
M
Lto
o
ls
•W
e
bS
e
rv
ic
e
sto
o
ls
•D
a
ta
b
a
s
eto
o
ls
•P
o
rta
l a
n
dp
o
rtle
td
e
v
e
lo
p
m
e
n
t
•E
n
te
rp
ris
eG
e
n
e
ra
tio
nL
a
n
g
u
a
g
e(E
G
L
)
to
o
ls
•D
e
b
u
g
g
e
r
•F
u
ll J
2
E
E1
.4s
u
p
p
o
rt
•P
o
rta
l T
e
s
tE
n
v
iro
n
m
e
n
t5
.0
.2
.2
•U
M
LV
is
u
a
l e
d
ito
rs
•S
ta
tica
n
dru
n
tim
ea
n
a
ly
s
is
•E
x
te
n
d
e
dd
e
b
u
g
g
in
ga
n
d
p
ro
filin
g
•C
o
m
p
o
n
e
n
tte
s
ta
u
to
m
a
tio
n
•C
le
a
rC
a
s
eL
Tfo
rte
a
m
in
te
g
ra
tio
n
•R
a
tio
n
a
l U
n
ifie
dP
ro
c
e
s
s(R
U
P
)
in
te
g
ra
tio
n
User
Interface
Services
HTML
JSP
WML
VML
JSF
Portlets
Servlets
Struts
JSF
JavaBeans
EJB
4GL
Control
Logic
Business
Logic
Enterprise
Information
Connection
JDBC
JCA
JMS
Web
Services
Business Process
Integration
WSDL
SOAP
UDDI
XML
BPEL
SOA
14 Rational Application Developer V6 Programming Guide
1.3.1 Summary of new features in Version 6
There are many new features in VERSION 6, many of which we highlight in detail
in the remaining chapters of this book. The objective of this section is to
summarize the new features in IBM Rational Application Developer V6.0:
򐂰 Specification versions: Full support for J2EE V1.4 and IBM WebSphere
Application Server V6.0. See “Specification versions” on page 18 for more
information on new features.
򐂰 Eclipse and IBM Rational Software Development Platform: Based on Eclipse
3.0. See “Eclipse and IBM Rational Software Development Platform” on
page 19 for more information on new features.
򐂰 Test server environments:
– Test environments included for WebSphere Application Server V6.0, V5.1,
V5.0, and WebSphere Portal V5.0.2.2, V5.1.
– Integration with IBM WebSphere Application Server V6.0 for deployment,
testing, and administration is the same (test environment, separate install,
and Network Deployment edition).
See “Test server environments” on page 22 for more information on new
features.
򐂰 Web Services:
– Build and consume Web Services with JSR 101/109 support for
implementing Web Services for EJBs and Java beans.
– Support for setting conformance levels, including WS-I SSBP 1.0 (simple
SOAP Basic Profile 1.0) and WS-I AP (Attachments Profile 1.0).
– Integrated SOAP Monitor to view Web Services traffic via creation wizard.
– Secure Web Services request/response capability using WS-Security
(security values specified in the J2EE deployment descriptor).
For more detailed information and a programming example, refer to
Chapter 17, “Develop Web Services applications” on page 951.
򐂰 Portal application development:
– Rational Application Developer V6.0 includes portal development tooling,
as well as integrated test environments for WebSphere Portal V5.0.2 and
V5.1.
– Model-View-Control (MVC) architecture for portal applications, including
support for JSF or Struts.
– Portal Site Designer for WebSphere Portal V5.0.2.2 and V5.1 to customize
the layout and navigation or portal pages.
– Wired portlets used to link portlets.
Chapter 1. Introduction 15
– Portlets for business process tasks via integration with WebSphere
Business Integrator (WBI).
– SAP and Seibel integration using JSF and SDO.
For more detailed information and a programming example, refer to
Chapter 18, “Develop portal applications” on page 985.
򐂰 Application modeling with UML:
– Model EJBs (top down or bottom up), Java classes, and database
schemas visually.
– New topic, browse, and sequence diagram views available for viewing
class relationships and method interaction.
– This feature is offered in Rational Application Developer and Rational
Software Architect (not Rational Web Developer).
For more detailed information and a programming example, refer to
Chapter 6, “RUP and UML” on page 189.
򐂰 Rational Unified Process® integration:
– Process Browser provides search capability for Rational Unified Process
(RUP®) best practices and life cycle for development.
– Process Advisor view displays RUP information specific to current task.
– This feature is offered in Rational Application Developer and Rational
Software Architect (not Rational Web Developer).
For more detailed information and a programming example, refer to
Chapter 6, “RUP and UML” on page 189.
򐂰 Annotated programming:
– EJB and Web resources can be created with annotations following the
proposed XDoclet standard (JSR 175).
– A number of required development resources are reduced since code is
generated at the time of deployment.
򐂰 Application code analysis: Application code can be reviewed for coding
practices. The application code analysis tool can identify the problem and
provide examples and a possible solution following best practice guidelines.
򐂰 Rapid Web Development:
– Page template provides a common and consistent look, feel, and layout
for Web applications. Page template fragments are now available with
support for nesting page templates.
– Web Site Designer provides group support for applying page templates
and creating navigation bars.
16 Rational Application Developer V6 Programming Guide
– Drag and drop page design and construction.
– Struts includes enhancements for the Web Diagram Editor for visual Struts
development and improved integration with portal.
– Point and click database access.
– Event-driven programming model.
– Automated code construction.
– Rich client construction.
– Robust Web services construction and consumption.
– XML integration and database access.
򐂰 JavaServer Faces (JSF):
– Full support for JSF 1.0 (JSR 127), plus additional IBM components
– Enhanced visual development of JSF with Web Diagram Editor, such as
visual layout of different actions and navigation of JSF pages
– Client components off new display formats for data
For more detailed information and a programming example, refer to
Chapter 13, “Develop Web applications using JSF and SDO” on page 673.
򐂰 Service Data Objects (SDO):
– Service Data Objects (SDO) offers a common API for working with data
across heterogeneous datastores.
– Access to different datastores becomes transparent as access is through
mediators.
– Developers can focus on real problems rather than spend time learning
low-level data access APIs.
– Available for use in Web and EJB components.
For more detailed information and a programming example, refer to
Chapter 13, “Develop Web applications using JSF and SDO” on page 673.
򐂰 Crystal Reports integration:
– New Report Designer included for designing Crystal Reports.
– JSF components for Crystal Enterprise included for adding Crystal
Reports to Web applications from Palette view.
– Development and testing licenses included for Crystal Enterprise V10
Professional and Embedded Editions.
– This feature is offered in Rational Application Developer and Rational
Software Architect (not Rational Web Developer).
For more detailed information refer to the product documentation.
Chapter 1. Introduction 17
򐂰 Enterprise Generation Language (EGL):
– High-level programming language for developing business logic
previously available in WebSphere Studio Application Developer V5
Enterprise Edition
– Easy language for non-Java developers for building applications
– Independent of implementation to hide the complexities of the technology
(encourages Rapid Application Development)
– EGL code generated to Java for runtime
For more detailed information and a programming example, refer to
Chapter 14, “Develop Web applications using EGL” on page 751
򐂰 Component testing:
– Easy creation, execution, and maintenance of dynamic unit tests for J2EE
components (Java classes, EJBs 1.1/2.0/2.1, Web services).
– Test patterns available for defining complex unit test cases.
– Test data can be stored in separate data pool table for flexible test case
definition.
– Based on JUnit framework and open source Hyades project.
– This feature is offered in Rational Application Developer and Rational
Software Architect (not Rational Web Developer).
For more detailed information and examples, refer to Chapter 20, “JUnit and
component testing” on page 1081.
򐂰 Profiling tools:
– Enhanced Memory Analysis features help locate memory leaks in heap
dumps
– New Thread Analysis view for monitoring thread state for locks
– New ProbeKit feature allows for easy profiling at key points in the
application using byte-code instrumentation
– Robust summary and detailed code and line execution statistics with Code
Coverage feature
For more detailed information and profiling examples, refer to Chapter 24,
“Profile applications” on page 1237.
򐂰 Additional enhancements:
– Database tools: Many enhancements around SQL Tools, SQLJ, and
importing, exporting, and deploying stored procedures and user-defined
functions.
– XML: Enhancements to WSDL, XML Schema, and XPATH editors.
18 Rational Application Developer V6 Programming Guide
– XSLT: New debugging capabilities allow developers to debug XSLT called
from Java and Java called from XSLT.
– WebSphere Programming Model Extensions (PMEs): Snippet and
Deployment Descriptors included to enable applications. Note that PMEs
are not included within the scope of this book.
1.3.2 Specification versions
This section highlights the specification versions found in IBM Rational
Application Developer V6.0, which supports development for the Java 2 Platform
Enterprise Edition V1.4. We have included WebSphere Studio Application
Developer V5.0 for comparison purposes, which is based on the Java 2 Platform
Enterprise Edition V1.3.
Table 1-5 includes a comparison of the J2EE specification versions, and
Table 1-6 on page 19 includes a comparison of the WebSphere Application
Server specification versions.
Table 1-5 J2EE specification versions
Specification Rational Application
Developer V6.0
WebSphere Studio
Application Developer V5.0
IBM Java Runtime Environment (JRE) 1.4.2 1.3.1
JavaServer Page (JSP) 2.0 1.2
Java Servlet 2.4 2.3
Enterprise JavaBeans (EJB) 2.1 2.0
Java Message Service (JMS) 1.1 1.0
Java Transaction API (JTA) 1.0 1.0
JavaMail 1.3 1.2
Java Activation Framework (JAF) 1.0 1.0
Java API for XML Processing (JAXP) 1.2 1.0
J2EE Connector 1.5 1.0
Web Services 1.1 1.0
Java API for XML RPC (JAX-RPC) 1.1 N/A
SOAP with Attachments API for Java
(SAAJ)
1.2 N/A
Chapter 1. Introduction 19
Table 1-6 WebSphere Application Server specification versions
1.3.3 Eclipse and IBM Rational Software Development Platform
This section provides an overview of the Eclipse Project as well as how Eclipse
relates to the IBM Rational Software Development Platform and IBM Rational
Application Developer V6.0.
Eclipse Project
The Eclipse Project is an open source software development project devoted to
creating a development platform and integrated tooling.
Java Authentication and Authorization
Service (JAAS)
1.2 1.0
Java API for XML Registries (JAXR) 1.0 N/A
J2EE Management API 1.0 N/A
Java Management Extensions (JMX) 1.2 N/A
J2EE Deployment API 1.1 N/A
Java Authorization Service Provider
Contract for Containers (JAAC)
1.0 N/A
Specification Rational Application
Developer V6.0
WebSphere Studio
Application Developer V5.0
JavaServer Faces (JSF) 1.0 (JSR 127) N/A
Note: JSF 1.0 included in
WSAD V5.1.2
Service Data Objects (SDO) 1.0 N/A
Note: SDO 1.0 formerly
named WDO included in
WSAD V5.1.2
Struts 1.1 1.0.2 and 1.1 Beta 2
Note: Struts 1.0.2 and 1.1
included in WSAD V5.1.1
and V5.1.2
Specification Rational Application
Developer V6.0
WebSphere Studio
Application Developer V5.0
20 Rational Application Developer V6 Programming Guide
Figure 1-4 on page 20 depicts the high-level Eclipse Project architecture and
shows the relationship of the following sub projects:
򐂰 Eclipse Platform
򐂰 Eclipse Java Development Tools (JDT)
򐂰 Eclipse Plug-in Development Environment (PDE)
Figure 1-4 Eclipse Project overview
With a common public license that provides royalty free source code and
world-wide redistribution rights, the Eclipse Platform provides tool developers
with great flexibility and control over their software technology.
Industry leaders like IBM, Borland, Merant, QNX Software Systems, RedHat,
SuSE, TogetherSoft, and WebGain formed the initial eclipse.org board of
directors of the Eclipse open source project.
More detailed information on Eclipse can be found at:
http://www.eclipse.org
Eclipse Platform
The Eclipse Platform provides a framework and services that serve as a
foundation for tools developers to integrate and extend the functionality of the
Platform. The Platform includes a Workbench, concept of projects, user interface
libraries (JFace, SWT), built-in help engine, and support for team development
and debug. The Platform can be leveraged by a variety of software development
Platform Runtime
Workspace
Help
Team
Workbench
JFace
SWT
Eclipse Project
Java
Development
Tools
(JDT)
Their
Tool
Your
Tool
Another
Tool
Plug-in
Development
Environment
(PDE)
Eclipse Platform
Debug
Other documents randomly have
different content
Am 20. Oktober Mittags zwölf Uhr begann die Verhandlung.
Die Richter waren aus dem Sitz des Generalkommandos
herübergekommen und saßen mit ernsten Gesichtern an dem langen
Tisch, ein Major, ein Hauptmann, ein Oberleutnant, ein
Kriegsgerichtsrat als Führer der Verhandlung und ein zweiter,
welcher die Anklage erhob.
Nachdem Schmitz nochmals den Sachverhalt geschildert, wurde Roth
als Zeuge vernommen. Er stellte die Angelegenheit im grellsten
Lichte dar, wollte nichts von einer Freundschaft wissen und leugnete
auch auf das Entschiedenste, ebenfalls betrunken gewesen zu sein,
wie es Schmitz behauptete. Als Zeugen seiner Nüchternheit hatte er
den Lungenkranken und den Polen gewonnen, welch' letzterem er
eingepaukt hatte, auf alle Fragen mit dem Kopfe zu schütteln, womit
er auch Glück hatte, da die Fragen zufällig entsprechend gestellt
waren. Schließlich beschwor der Vicewachtmeister mit fester Stimme
die Wahrheit seiner Aussage.
Das war allerdings eine unerwartete Wendung. Schmitz hatte nicht
erwartet, auch noch mit der Lüge kämpfen zu müssen, und seine
Hoffnungen sanken beträchtlich, als er den Major mißbilligend mit
dem Kopfe schütteln sah.
Es folgte sodann die Anklagerede des Kriegsgerichtsrats, die etwa
wie die Anklageschrift lautete.
Sodann erhob sich der Verteidiger. Mit beredten Worten schilderte er
nochmals den Vorgang, erwog die näheren Umstände, wies auf das
ihm durch Zeugen bestätigte frühere Verhältnis der Gegner und
schließlich darauf hin, daß sich der ganze Vorgang im Anschluß an
eine Geburtstagsfeier zugetragen habe. Nach alledem, und mit
Rücksicht auf die bisherige Führung des Angeklagten sei auf
Freisprechung zu erkennen.
Das Gericht zog sich zur Beratung zurück und es dauerte lange, bis
die Herren mit ernsten Gesichtern wieder im Verhandlungszimmer
erschienen.
Schmitz glaubte einen Augenblick die Besinnung verlieren zu
müssen, als er das Urteil vernahm: zwei Monate Gefängnis!
Er sah sein Leben vernichtet. Umsonst waren die langen Jahre, die
er mit Aufopferung seiner besten Kraft dem Vaterlande gedient;
seine Zukunftspläne, nach zwölfjähriger Dienstzeit eine Anstellung
am Bürgermeisteramt seiner Vaterstadt zu erhalten, waren mit
einem Schlage vernichtet. Was würden seine Eltern, seine
Geschwister sagen, was sollte aus seiner Braut werden?
Eine namenlose Wut packte ihn, den Mann hätte er auf der Stelle
würgen können, der mit Gemeinheit, Lüge und Meineid sein Dasein
zerstört und jetzt mit höhnischer Miene an ihm vorüberschritt. Ja, er
hörte den Kommandeur zu dem ehrlosen Lumpen sagen: »So ist's
recht, Roth, scharf im Dienst, so wünsche ich mir meine
Unteroffiziere.«
Nun, die Rache sollte nicht ausbleiben. Schmitz wurde am 21.
Oktober durch einen Wachtmeister auf Festung gebracht, wo viele
Stunden der Selbstverleugnung und schwere Tage seiner warteten.
So kam allmählich die Weihnachtszeit heran. Schnee bedeckte den
Kasernenhof, alles lag öde, leblos und starr durch die grimmige Kälte
der letzten Tage.
Ein großer Teil der Mannschaften hatte Urlaub für die Festtage
erhalten, und ein jeder nahm im Dienst seine ganze Kraft
zusammen, um nicht im letzten Augenblick der zu erwartenden
Freuden beraubt zu werden.
Fast allabendlich fuhren die Herren des Offizierkorps, natürlich ohne
Urlaub, nach der Nachbarstadt, um Weihnachtseinkäufe zu machen,
denn nach Hause fahren wollte nur einer von ihnen, die anderen
beabsichtigten eine kleine Feier im Kasino, wo sie sich gegenseitig
kleine Geschenke zu machen gedachten.
Borgert und Leimann kehrten stets mit Packeten beladen zurück, sie
kauften alles, was ihnen gefiel, Geld würde sich später einmal
finden, denn jetzt pumpte ja jeder mit Freuden, wenn er nur seine
Ware los wurde.
An den geschäftlichen Teil in der Stadt schloß sich meist ein kleines
Gelage in einem guten Restaurant, und oft kam es vor, daß die
Herren in recht angeregter Stimmung den letzten Zug zur Garnison
bestiegen.
Eines Abends hatte auch der neue Riesling besonders gut
geschmeckt, und alle langten ziemlich »blau« in später Nacht zu
Hause an.
Der Regimentsadjutant fand ein Diensttelegramm in seiner Wohnung
vor und mußte sich noch einmal, trotz der späten Stunde zum
Regimentsschreiber begeben, um mit diesem über die Erledigung
des Telegramms Rücksprache zu nehmen.
Starker Schneefall war eingetreten, und der scharfe Ostwind trieb
die Flocken in wildem Wirbelspiel durch die kalte Luft, sodaß man die
Augen zusammenkneifen mußte und nur mit Mühe den zugewehten
Weg erkennen konnte.
Die Störung zu mitternächtlicher Stunde paßte dem bequemen
Müller gar nicht und er schimpfte vor sich hin, als er die Allee zur
Kaserne entlang schritt. Auch pflegte er in angeheitertem Zustand
meist schlechte Laune zu haben, war händelsüchtig und brach gerne
einen Streit vom Zaune, in dessen Verlauf er in unschöner Weise auf
seine Sonderstellung als Adjutant und seine dabei gewonnene
Diensterfahrung hinwies. Die Kameraden nannten es Größenwahn.
Durch die schneeerfüllte Luft sah man nur vor dem hellen Fenster
der Wachtstube die dicken Flocken in wildem Spiele tanzen, drinnen
aber schlief der Wachthabende und neben ihm zwei Gemeine.
Der Offizier vom Dienst war schon dagewesen und so hatte man es
sich bequem gemacht, der Vorschrift entgegen Säbel und Helm
abgelegt, den Rock geöffnet und eine warme Decke aus der Kaserne
herbeigeholt.
Auf Posten stand der Gemeine Röse. Er hatte in dem Schilderhaus
Schutz vor dem Unwetter gesucht und stand, den Säbel in der kalten
Faust, an der Rückwand des schwarz und weiß gestrichenen
Häuschens. Warum sollte er das nicht? Es war ja ausdrücklich
gestattet!
Seine Gedanken weilten in der Ferne bei den Eltern und
Geschwistern, die er in zwei Tagen zum ersten Male seit langer
Trennung wieder sehen sollte. Wie freute er sich auf diese Stunde,
da er nun als schmucker Kavallerist die Lieben daheim begrüßen,
alte Freunde und im Stall den »Hans«, das brave Pferd, die blanken
Kühe und die fetten Schweine wiedersehen durfte!
Aus seinen Gedanken schreckte ihn plötzlich ein lauter Ruf:
»Posten!«
Röse blinzelte durch die runde Luke an der Seitenwand des
Schilderhauses, konnte aber niemand entdecken. Erst auf einen
nochmaligen, laut durch die Winternacht hallenden Ruf trat er
heraus und erkannte in dem undurchsichtigen Schneetreiben eine
Gestalt, welche auf ihn zukam.
»Warum präsentieren Sie nicht, Sie Schwein!« brüllte der
Regimentsadjutant.
»Verzeihen Herr Leutnant, ich habe Herrn Leutnant nicht gesehen.«
»Halt' die Schnauze, verlogenes Aas, geschlafen hast du im
Schilderhaus, eine Ewigkeit stehe ich hier und warte. Aber ich werde
dir zeigen, du Bauer, was du zu tun hast!«
Damit schritt er vorbei und ließ Röse in starrem Schrecken stehen.
Aus dem Regimentsgeschäftszimmer schrieb er folgende Meldung:
»Den von 12 bis 2 stehenden Posten fand ich bei einer Revision
schlafend im Schilderhause vor. Derselbe trat erst nach zweimaligem
Anruf heraus. Etwaige Einwendungen des Mannes, mich nicht
gesehen zu haben, muß ich von vornherein als Unwahrheit
bezeichnen, da ich genau bemerkt habe, daß er geschlafen hat.«
Die Meldung legte er auf den Arbeitstisch des Kommandeurs. Dann
holte er den Schreiber aus dem Bett, verhandelte mit dem im Hemd
auf dem kalten Korridor vor ihm stehenden Manne fast zehn Minuten
und schritt dann seiner Wohnung zu. Er hatte jetzt sein Mütchen
gekühlt und konnte ruhig schlafen. — —
Am Nachmittag des 22. Dezember kehrte Sergeant Schmitz aus dem
Gefängnis zurück.
Die früher so stolze, stramme Haltung hatte er verloren, sein Gesicht
war bleich und der sonst so keck in die Höhe gewirbelte schwarze
Schnurrbart hing strähnig um die Mundwinkel. Scheu sah er die ihm
Begegnenden an, und wenn ein Soldat ihn grüßte, hielt er es für
eine besondere Freundlichkeit, die ihm nicht zukomme, da er
glaubte, in aller Augen zu lesen:
»Seht, das ist ein Bestrafter, ein Verbrecher!«
Als er sich beim Schwadronchef zurückmeldete, reichte ihm dieser
die Hand.
»Tut mir leid, mein lieber Schmitz, daß ich Sie verlieren muß, Sie
waren mir stets ein Untergebener, auf den ich stolz war und der
seinen Dienst wie kein zweiter getan hat. Aber der Oberst hat
befohlen, daß ich die Kapitulation mit Ihnen aufhebe und Sie sofort
entlasse. Der Wachtmeister wird mit Ihnen das Nötige ordnen.
Trösten Sie sich mit dem Gedanken, daß Sie das Opfer einer
gemeinen Gesinnung geworden sind, und so wünsche ich Ihnen alles
Gute; wenn Sie mich brauchen können, bin ich stets mit Freuden
bereit. Leben Sie wohl!«
Schmitz unterdrückte mit großer Mühe das Weinen, der Rittmeister
aber ging dem Stall zu. Es ging ihm wirklich nahe, dieser nette,
stramme Kerl, eine Stütze der Schwadron, um nichts und wieder
nichts ins Unglück gestürzt und auf die Straße gesetzt! Es war eine
Schweinerei!
So ging denn Schmitz zum Wachtmeister, der ihm seine Papiere und
fünfzig Mark auf sein Sparkassenbuch übergab. Auch er drückte ihm
bewegt die Hand.
»Haben Sie noch Invalidenansprüche, Schmitz?« fragte er darauf.
»Ich habe Rheumatismus seit dem Manöver, wo wir wegen
Seuchenverdacht der Pferde drei Wochen biwakieren mußten!«
»Das haben Sie aber damals nicht gemeldet, und es ist schon fast
1½ Jahre her.«
»Gemeldet habe ich es nicht, weil ich mich nicht krank schreiben
lassen wollte, ich mochte den Rittmeister mit den
heruntergekommenen Pferden nicht sitzen lassen.«
»Ich werde beim Regiment sofort Meldung machen, Sie können ja
einstweilen Ihre Sachen abgeben!«
So stieg denn Schmitz zu seiner Stube hinauf, packte die
Montierungsstücke zusammen und schnürte seine paar
Habseligkeiten in einen kleinen Koffer. Ehe er aber seine Uniform
auszog, ging er in die Stadt und kaufte für 45 Mark einen Zivilanzug,
einen Kragen und einen Hut. Schuhe besaß er noch.
Dann brachte er alle Uniformstücke dem Quartiermeister auf die
Kammer, dem er auch seinen Extrarock, eine eigene Mütze und eine
lange Hose für dreißig Mark verkaufte. Den Säbel wollte er als
Erinnerung aufheben.
Jetzt kam das Schwerste, der Abschied von den Kameraden und den
Pferden. Jeder hatte ein freundliches Wort für ihn, und mancher
stumme Händedruck gab den schmerzlichen Gefühlen Ausdruck, mit
denen man den lieben Kameraden scheiden sah. Selbst die
Mannschaften drängten sich heran, um von ihm Abschied zu
nehmen, er hatte sie zwar manchmal tüchtig vorgenommen, aber sie
kannten ihn als einen anständigen Kerl, der sie nicht im Stiche ließ,
wenn es darauf ankam.
Als der Mittagsstalldienst zu Ende war, ging Schmitz in den Stall. Kein
Gang war ihm im Leben so schwer geworden, wie dieser, und als er
die geliebten Tiere aus den eben gefüllten Krippen zu sich aufblicken
sah, sobald sie seine Stimme hörten, da hätte er laut aufschreien
mögen vor Weh und Schmerz.
Für »Klärchen« hatte er ein Stück Zucker mitgebracht und sowie er
zu ihm in den Stand trat, suchte es gleich nach dem gewohnten
Leckerbissen und bat mit gehobenem Fuß um einen zweiten. Er
legte seinen Kopf an den sammetweichen Hals des Tieres, strich ihm
kosend über die schönen Augen und die weichen Nüstern und küßte
das Tier auf den Hals. Als er es verließ, glaubte er in dem traurigen
Blick und den leisen Wiehern einen Abschiedsgruß zu empfinden.
Auch von der alten »Marie« nahm er Abschied. Wie lange mochte sie
wohl noch den Dienst aushalten? Zuletzt ging er zu »Napoleon«,
dem Schmerzenskinde, aber auch er zeigte heute keine Spur der
gewohnten Bösartigkeit, sondern sah den fremden Mann in Zivil mit
fragenden Augen an.
Noch einen letzten Blick warf er auf seine Lieblinge, dann ging er mit
unterdrücktem Schluchzen wieder der Stube zu, um seinen Koffer zu
holen.
Im Eingang trat ihm der Wachtmeister entgegen.
»Mit Ihren Invalidenansprüchen ist es nichts, Schmitz, der Oberst
hat gesagt, Sie hätten es gleich melden müssen, jetzt könnte jeder
kommen. Dann hat er mir noch die Rechnung Ihres Rechtsanwaltes
übergeben, der das Regiment um Eintreibung der Schuld ersucht
hat. Es sind sechzig Mark, wenn Sie nicht zahlen können, soll eine
Pfändung vorgenommen werden.«
Daran hatte Schmitz gar nicht mehr gedacht.
»In einer Stunde ist das Geld zur Stelle, Herr Wachtmeister!« sagte
er nach kurzem Bedenken.
Darauf ging er der Stadt zu und trat bei einem Uhrmacher ein, legte
seine silberne Uhr mit Kette auf den Ladentisch und fragte mit fester
Stimme:
»Was geben Sie mir dafür? Ich brauche Geld!«
Der Uhrmacher besah mit spöttischen Augen das Stück und sagte
dann achselzuckend:
»Zwanzig Mark, das ist aber reichlich Geld.«
Schmitz rechnete. Fünfunddreißig hatte er noch, zwanzig dazu
machte fünfundfünfzig, es fehlten noch fünf Mark. Da streifte er
entschlossen einen Ring vom Finger, das einzige Andenken an seinen
verstorbenen Vater.
»Was ist Ihnen der wert?«
»Zehn Mark, mehr nicht!«
»Gut, geben Sie her, Sie haben es dafür!« Schmitz strich die drei
Goldstücke ein, ging zur Kaserne, zahlte dem Wachtmeister sechzig
Mark aus und holte seinen Koffer, um den Abendzug zur Stadt noch
zu erreichen.
Wer den bleichen Mann mit dem kleinen Koffer gesenkten Blickes
dahinziehen sah, ahnte nicht, daß es ein königlich preußischer
Sergeant war, der jetzt eines ungeschickten kleinen Vergehens
wegen, ohne einen Pfennig, aber mit Rheumatismus in allen
Knochen und einer zertretenen Vaterlandsliebe im Herzen auf die
Straße gesetzt war, um sich ein neues Lebensziel zu suchen,
nachdem er seine beste Kraft, seine Gesundheit und seine Jugend
dem Staat geopfert hatte.
Auf der Anhöhe, von welcher aus man einen Blick auf die in ihrem
weihnachtlichen Schneegewande ruhende Kaserne hatte, schaute er
noch einmal hinunter und schüttelte drohend den Arm, einen
wütenden Fluch ausstoßend.
Dann bestieg er auf dem Bahnhof einen Wagen vierter Klasse
desselben Zuges, in welchem zahlreiche Soldaten singend und
scherzend nach der Heimat fuhren, um dort im Kreise der Familie
das Weihnachtsfest zu feiern. —
Der Abend des 24. Dezember war gekommen. Alle Welt, Tausende,
Millionen waren heute glücklich, fühlten den Zauber, den das
schönste aller Christenfeste selbst auf das härteste Gemüt ausübt,
weil es heilige Erinnerungen in uns weckt. Es ist das hohe Fest der
Liebe Gottes zum Menschen, der Liebe des Christen zum Nächsten.
Und keiner ist es, den nicht der feierliche Klang der
Weihnachtsglocken in eine weiche Rührung, eine stille Andacht
versetzt: der mächtige König im Palast und der Arme in seiner Hütte,
selbst der Verbrecher hinter der Kerkermauer, alle öffnen ihr Herz
den Strahlen der Liebe, die es an diesem Abend durchleuchten.
Friedrich Röse saß in der schlecht erwärmten Arrestzelle, in welcher
er die 14tägige Strafe wegen Wachtvergehens verbüßte.
Durch den mit Eisblumen bedeckten kleinen Lichtschacht sah er
hinauf nach dem Fenster im ersten Stock der 3. Eskadron, wo ein
Weihnachtsbaum im Lichterglanz erstrahlte. Schwermütig ernst
ertönten die Klänge jenes ewig schönen Weihnachtsliedes, dessen
Musik gerade in ihrer Eintönigkeit ergreifend wirkt. Fröstelnd saß er
auf dem Rand der harten Holzpritsche, und eine Träne rollte über die
Wangen hinab auf das Steinpflaster des Fußbodens. Wieder weilten
die Gedanken daheim, aber nicht freudig, erwartungsvoll, sondern
Verstimmung, Schmerz und Sehnsucht lagen in den Zügen des
jungen Mannes.
Mit welcher Freude, welchem Eifer hatte er sich zum Militär
gemeldet! Schon sein Vater, einst Wachtmeister der Gardekürassiere,
schilderte das herrliche Soldatenleben in den schönsten Farben und
hatte keinen größeren Wunsch, als seinen Jungen einmal als flotten
Unteroffizier wiederzusehen.
Aber das gab es jetzt nicht mehr, er war bestraft mit strengem
Arrest, gebrandmarkt für seine ganze Dienstzeit.
Die freudige Lust am Soldatenstande hatte sich mit einem Male in
Haß und Ingrimm verwandelt gegen den bunten Rock, gegen alles,
was Soldat sein bedeutete, mit einem Schlage war aus dem
diensteifrigen, strebsamen Rekruten einer von den vielen geworden,
die nur Soldat sind, weil sie es müssen und die den Tag der
Entlassung als den ihrer Freiheit ersehnen.
Und warum war das alles?
Nicht weil er wissentlich seine Pflicht verletzt hatte, sondern weil es
einem jener Herren Offiziere einfiel, die Laune seiner Trunkenheit an
dem ersten besten Opfer auszulassen, das ihm in die Hände fiel. Und
was der Herr in seiner Meldung behauptete, stand als bombenfeste
Tatsache da, wer daran zweifelte, beging ein neues Vergehen, die
Achtungsverletzung.
Röse hatte auf die bezügliche Frage seines Rittmeisters den Vorgang
geschildert und seine Unschuld hoch und heilig beteuert, aber der
Adjutant hatte hierauf erwidert, der Mann wolle sich jetzt
herauslügen. Was er gemeldet habe, sei Tatsache.
Oder sollte er zugestehen: Ich habe dir Unrecht getan, habe mich
geirrt, denn ich war betrunken und übler Laune? Fiel ihm gar nicht
ein, er konnte sich diese Blöße nicht geben. Wie durfte er, der
unnahbare, nie fehlende Regimentsadjutant eingestehen, sich geirrt
zu haben? Er irrte sich eben nie, und was schadete es groß dem
Kerl, wenn er die paar Tage brummte?
Was es schadete?
Daß es einen Apostel mehr gab, der verkündete, er sei als Soldat ein
gepeinigter, in ein beschwerliches Joch gezwungener Mensch, der
Spielball seiner Vorgesetzten gewesen, die ihre Laune an ihm
ausließen, wie es ihnen behagte, daß unverdiente Härte und
Ungerechtigkeit, gegen die es keine genügende Waffe gab, da zu
finden gewesen seien, wo indviduelle Behandlung, Rücksicht und
einsichtsvolle Überlegung am Platze wären.
Und was es weiter schadete?
Daß Jedermann, dem Röse in späteren Jahren seine Papiere
vorlegte, die Achseln zuckte und dachte: »Du scheinst mir auch kein
zuverlässiger Bruder zu sein, 14 Tage wegen Wachtvergehens, das
ist übel!« — — — —
Gegen neun Uhr schreckte Röse ein Geräusch an der Tür aus seinen
Gedanken. Ein Schlüsselbund klapperte, das Schloß schnappte und
herein trat der Offizier vom Dienst, hinter welchem der
Wachthabende stand.
Röse sprang auf, nahm eine militärische Haltung ein und meldete:
»Gemeiner Röse mit 14 Tagen wegen Wachtvergehens bestraft!«
Der Offizier schaute einen Augenblick in das Innere der dunkelen
Zelle, ob er nicht etwa einen verbotenen Gegenstand außer der
Schlafdecke und dem Wasserkrug entdeckte, dann wandte er sich
zum Gehen. Da sagte Röse zögernd:
»Gestatten der Herr Leutnant eine Bitte?«
»Wenden Sie sich an den Wachthabenden, wenn Sie etwas wollen«,
entgegnete der Offizier kurz und tappte die Steintreppe hinunter,
vorsichtig um sich schauend, daß er sich den grauen Mantel an dem
staubigen Treppenhaus nicht beschmutze.
Der Wachthabende begleitete ihn bis zum Ausgang und kehrte dann
zu Röse zurück.
»Was wolltest du denn?« fragte er wohlwollend.
»Ich wollte bitten, wenn ein Brief für mich da wär, daß ich ihn jetzt
bekommen kann, Herr Unteroffizier!« antwortete Röse schüchtern.
»Ja, mein Junge,« lachte der Unteroffizier gutmütig, »das geht
eigentlich nicht — erst absitzen, dann's Vergnügen.« Wie er aber
Röse, der von seiner Schwadron war und den er gut leiden mochte,
mit dem trübseligen Gesichte vor sich stehen sah, tat ihm der arme
Junge leid. Es war doch eine harte Sache, hier den heiligen Abend
verleben zu müssen und obendrein wegen einer solchen Lappalie,
und schließlich sogar unschuldig. Er sagte daher freundlich zu Röse:
»Na ja, ich werde mal nachfragen lassen.«
Er verschloß die Zelle wieder und schickte einen Mann zu Röse's
Berittführer mit der Bitte, doch einmal zu ihm zu kommen. Und als
dieser herbeigekommen war, fragte der Wachthabende den
Berittführer:
»Ist ein Brief für den Röse da?«
»Ein Brief nicht, aber ein Packet habe ich für ihn vom Wachtmeister
bekommen!«
»Weiß du was?« flüsterte der Wachthabende, »mach die Kiste auf
und bring dem Kerl was rüber, das arme Luder tut mir leid.«
Der Berittführer nickte und verschwand, um bald mit einem Brief,
einer Wurst und einem Stück Kuchen zurückzukehren. Der
Wachthabende nahm alles in Empfang und stieg zu Röse hinauf.
Gleichzeitig hieß er einen Mann mit einem Eimer Kohlen mit sich
gehen.
Nach wenigen Minuten flackerte das Feuer in der Zelle wieder hell
und Röse stand davor, um beim flackernden Schein den Brief der
Eltern zu lesen. Dabei rannen ihm beständig die Tränen über die
Backen. Dann versteckte er wie einen kostbaren Schatz Wurst und
Kuchen hinter der Pritsche, hüllte sich in seine Decke ein und legte
sich auf das harte Holzbett nieder.
Bald schloß der Schlaf die verweinten Augen, und im Traum saß
Röse daheim unter'm Weihnachtsbaum im Kreise seiner Eltern und
Geschwister.
Der 28. Dezember war ein Trauertag für die vierte Schwadron.
Die Leute, die erst am Abend vorher von Urlaub zurückgekehrt
waren, gaben heute einem Kameraden das letzte Geleit: man trug
den Gefreiten Dietrich zum Friedhof hinaus.
Er war stets ein schwächlicher Mensch gewesen. Damals aber, als er
erhitzt und vom Regen durchnäßt in die kalte Stube kam und kein
Feuer anbrennen konnte, weil ihm Roth die Kohlen verweigerte,
packte ihm am selbigen Abend ein heftiges Fieber. Nach zwei Tagen
stellte der Arzt Gelenkrheumatismus fest, der so stark auftrat, daß
das Herz in Mitleidenschaft gezogen wurde und der Arme am ersten
Weihnachtsfeiertage an Herzschlag starb.
Die tieferschütterten Eltern hatten zwar telegraphisch um
Überführung der Leiche ihres einzigen Sohnes zum Heimatsort
gebeten, doch da das Geld für einen Zinksarg und den Transport
nicht kam, fand die Beerdigung auf dem Garnisonsfriedhof statt.
Am nächsten Tage wurde auch der vom Pferde geschlagene dicke
Reserve-Gefreite aus dem Lazaret entlassen. Seine Verletzungen
schienen zwar geheilt, doch war das ganze Gesicht durch die
zurückgebliebenen Narben schrecklich entstellt und das linke Auge
durch eine Operation entfernt worden, da man infolge der
Verletzung desselben fürchtete, das andere Auge könnte in
Mitleidenschaft gezogen werden.
So kehrte denn der Unglückliche als Halbinvalide mit einer
monatlichen Pension von neun Mark in die Heimat zurück.
Der ehemalige Sergeant Schmitz saß am Sylvesterabend in seiner
dürftigen Stube.
Er hatte sich, um der äußersten Not vorzubeugen, als Arbeiter einer
großen Fabrik der Nachbarstadt verdingt und konnte so wenigstens
seinen Lebensunterhalt verdienen. Er bewohnte ein mäßiges Zimmer
im zweiten Stock eines Arbeiterhauses und wurde von der darin
hausenden Familie gegen geringes Entgeld mit verpflegt.
Jetzt saß er am Tisch, den Kopf in beide Hände gestützt. Vor ihm
stand ein Teller mit den Resten des kärglichen Abendbrotes, und
eine kleine Lampe mit zerbrochenem Schirm warf einen matten,
rötlichen Schein auf die am Tisch sitzende Gestalt und die ärmliche
Einrichtung des kleinen Raumes. An der Wand stand ein eisernes
Bett mit rot und weiß kariertem Bezug, und darüber waren Klinge
und Scheide des Säbels übers Kreuz befestigt.
Auf einem kleinen Holzschemel stand eine Waschschüssel, daneben
lag ein graues Handtuch. Das Feuer in dem kleinen Ofen war längst
erloschen, nur einzelne klimmende Köhlchen lebten noch darin.
Wer den Mann da sitzen sah, konnte glauben, einen Schlafenden vor
sich zu haben, aber Schmitz wachte, und in seinem Kopf jagten
wilde Gedanken durcheinander. Er dachte an vergangene Zeiten, und
je schroffer ihm seine jetzige Lebenslage von früheren Zeiten
abzustechen schien, um so grimmiger wurde sein Haß gegen den,
welcher ihn in seine jetzige Lage gebracht; er sann auf Rache, wie er
jenen elenden Schurken strafen und brandmarken könne für seine
gewissenlose, gemeine Handlungsweise.
Eine Weile noch saß er brütend da, dann erhob er sich mit finsterem
Gesicht und trat an's Fenster, hauchte ein kleines Loch in die dicken
Eisblumen und schaute hindurch nach der erleuchteten Uhr des
Kirchturmes, aus dem jetzt das melodische Läuten der Glocken in die
kalte Nacht hinaus drang, das Herannahen des neuen Jahres
kündend.
Elf Uhr! Schmitz setzte seinen Hut auf, ergriff den Spazierstock, blies
die Lampe aus und ging die dunkle Treppe hinab.
Auf der eisbedeckten Steinstufe vor der Haustür verweilte er einen
Augenblick und lauschte dem dumpfen, feierlichen Glockenton. Sonst
vernahm man keinen Laut, keinen menschlichen Tritt, nur ein fernes
Rauschen wie ein Atem erfüllte die Luft, der Atem einer Großstadt in
der Silvesternacht.
Schmitz schlug fröstelnd den Rockkragen hoch, steckte beide Hände
in die Hosentaschen und ging, den Stock unter'm Arm, eiligen
Schrittes dem Bahnhof zu, wo er für 20 Pfennig eine Fahrkarte nach
seiner früheren Garnison erstand und den bereitstehenden Zug
bestieg.
Das kleine Städtchen lag wie ausgestorben in seiner schneeichten
Hülle. Von der Kaserne flimmerten die hell erleuchteten Fenster wie
Sterne herüber, und mitunter tönten abgebrochene Weisen eines
Gesanges, oder einzelne Akkorde, vom Winde sanft getragen,
klangen in die Nacht hinaus. In der Ferne summte es von dem
Läuten zahlreicher Kirchenglocken, welche in den vielen
umliegenden Dörfern und Flecken das neue Jahr begrüßten. Aus den
hell erleuchteten Kneipen und Restaurationen aber ertönte lautes
Reden, Lachen und Gesang fröhlicher Zecher, die dem neuen Jahr
einen frischen Trunk entgegenbrachten.
Schmitz ging dem Stadtende zu, an welchem die Kaserne lag und
machte vor einem Wirtshause Halt. Scheu blickte er um sich, ob
Niemand ihn beobachte, dann stieg er auf den Rand der Mauer und
schaute durch das angelaufene Fenster.
Richtig, dort saß der Roth, im Kreise einiger Unteroffiziere und
Gefreiten, denn hier pflegte er allabendlich bis in die tiefe Nacht zu
zechen oder ein Spielchen zu machen.
Vorsichtig stieg er wieder herab und schritt der Kaserne zu. Er bog in
einen zu beiden Seiten mit beschneiten Hecken eingefaßten
Richtweg und stellte sich an der ersten Biegung auf. Hier pflegte
Roth auf dem Heimweg vorbeizukommen.
Schmitz mußte lange auf seinem Posten ausharren, aber es war ihm
wohl zu Mute.
Die bittere Kälte des Tages war um Mitternacht einer lauen
Winterluft gewichen, ein sanfter Wind trieb seine Schneeflöckchen
vor sich her und ließ die dürren Blätter der Buchenhecke rascheln.
Unten, wo der schmale Weg in die Straße einbog, sah man mitunter
eine Gestalt wie einen Schemen schwankenden Schrittes in dem
Dunkelgrau der Nacht auftauchen und lautlos auf der weichen
Schneedecke wieder verschwinden — Zecher, die nach reichlichem
Trunk der Ruhe des Bettes bedurften. —
Schmitz fühlte keine Spur von Kälte, denn bei jedem neuen Schlag
der fernen Turmuhr trieb ihm das Blut schneller durch die Adern,
immer näher rückte der Augenblick, auf den er sich schon so lange
gefreut.
Endlich, es hatte eben zwei Uhr geschlagen, nahte eine dunkle
Gestalt.
Der Wartende drückte sich an die Hecke und faßte den Stock fester,
das Herz klopfte ihm zum Zerspringen.
Schon war Roth auf wenige Meter herangekommen, das Gesicht fast
ganz in dem hochgeschlagenen Mantelkragen versteckt, aber
Schmitz erkannte den Wachtmeister genau, wie er, einen
Gassenhauer vor sich hinpfeifend, mit schleppendem Säbel
schwankenden Ganges daher kam.
Als der Wachtmeister nur noch einige Schritte hatte, um neben
Schmitz zu sein, trat dieser, den Stock auf der Schulter, breitbeinig
vor seinen Gegner hin.
Roth stutzte einen Augenblick wie ein scheues Wild, dann sah er sein
Gegenüber scharf an. Er erkannte ihn nicht.
»Was wollen Sie?« brachte er mit trockener Kehle hervor.
»Mit dir abrechnen will ich«, war die kurze Antwort, die dem
Vizewachtmeister das Blut erstarren machte.
Einen Augenblick standen die beiden Männer einander gegenüber, da
erkannte Roth seinen ehemaligen Freund.
»Ach, du bist es, alter Kerl, was willst du denn hier?« stieß er mit
heiserer Stimme hervor.
»Das will ich!« schrie Schmitz und ließ seinen Stock sausend durch
die Luft fahren. Der erste Schlag traf den Gegner mitten ins Gesicht.
Der zum Tod Erschrockene taumelte einen Augenblick, ehe er aber
seinen Säbel ergreifen konnte, sauste ihm ein kräftiger Hieb nach
dem anderen in's Gesicht, auf den Kopf, die Schultern und Hände.
Da stürzte er sich wie ein wildes Tier auf seinen Gegner. Schmitz
aber holte aus und gab dem Wachtmeister eine schallende Ohrfeige,
daß er rücklings zu Boden fiel.
»So, du ehrloser Hund, du feiges, dreckiges Aas, das war für deine
gemeine Gesinnung und das ist für deine Lügerei!« Dabei gab er
dem am Boden Liegenden einen derben Tritt und entfernte sich.
Im Gehen rief er noch spöttisch seinem Opfer zu:
»Jetzt darfst du mich wieder melden, du Schweinehund, aber dann
habe ich so Verschiedenes zu erzählen!«
Nun war dem alten Futtermeister wieder wohl um's Herz, jetzt
konnte er sein Schicksal ruhiger tragen, denn er wußte den Gegner
gestraft. Die Rache ist doch süß!
Vizewachtmeister Roth mußte mehrere Wochen im Lazarett
verbringen, bis seine Wunden im Gesicht und an den Händen geheilt
waren. Er hatte angegeben, von einem betrunkenen Arbeiter
überfallen worden zu sein und behauptete, ihn mit dem Säbel zu
Boden gestreckt zu haben.
Daran wollte aber niemand recht glauben, denn es meldete sich
weder ein verwundeter Arbeiter, noch war ein solcher durch
Nachfragen bei den Ärzten der Umgegend festzustellen. Im Stillen
wußte jeder, aus welchem Laden der verhaßte Wachtmeister seine
Prügel bezogen hatte.
Schmitz aber feierte in der Silvesternacht seine Rachetat durch
einige Glas Bier, die er sich lange nicht geleistet hatte. Als er beim
Schein der Lampe Blut an seiner Hand entdeckte, wischte er es ab
wie das eines räudigen Tieres und warf sein Taschentuch in's Feuer.
Dann rief er lustig:
»Noch eins, Herr Wirt!«
Viertes Kapitel.
In den letzten Tagen des Januar herrschte in den Räumen des
Offizierskasinos rege Tätigkeit.
Ein ganzes Aufgebot von Tischlern, Malern und Gärtnern war damit
beschäftigt, die Zimmer und Korridore samt Veranda und
Wintergarten in einen Festplatz mit zahlreichen Buden und Zelten
umzuwandeln, damit Prinz Karneval in den ersten Tagen des Februar
einen würdigen Einzug halten könne.
Unter dem Dach grünender Bäume waren buntbemalte, mit Plakaten
aller Art bedeckte Schaubuden aufgeschlagen, in denen es köstliche
Leckerbissen und allerlei Getränke, vom einfachsten Selterwasser bis
zum echten Französischen, zu kaufen geben sollte, in einer anderen
sollten einige als wilde Tiere frisierte Soldaten in Freiheit vorgeführt
werden, ein drittes Zelt war als Bühne hergerichtet, auf welcher man
durch Spezialitätenvorstellungen die Lachmuskeln der Festbesucher
in Bewegung halten wollte. Zwei mit Bänken besetzte Rasenplätze
luden zu den Genüssen einer Musikbande und echten Pilseners ein,
während im Nebenzimmer ein Standesamt errichtet war, wo man
sich unter Verabfolgung eines Glases Sekt für zehn Pfennig trauen
und nach einer Stunde wieder scheiden lassen konnte.
Der große Speisesaal stellte den Hauptfestplatz dar. Auf einer mit
Zweigen umkränzten Kanzel war Platz für ein Musikkorps, und die
Trompeter des Regiments schweiften täglich in der ganzen Gegend
umher, um irgendwo ein recht zerlumptes Musikantenkostüm
aufzutreiben.
Sogar eine Photographierbude fehlte nicht, an deren Außenwand die
verlockendsten Porträts und Gruppenbilder zu sehen waren.
Natürlich bildete die bevorstehende Festlichkeit den
Hauptgesprächstoff während des Offiziersmittagstischs. Jeder wollte
so originell als möglich angezogen erscheinen, und es war ein langes
Hin- und Herberaten, bis man sich über das zu wählende Kostüm
schlüssig wurde.
So kam der Tag des Festes allmählich heran. Am Nachmittag traf ein
kleines Heer von Friseuren ein, und der Regimentsschneider zog mit
seiner Nadelgarde von einem Herrn zum anderen, um noch
Änderungen an den Kostümen vorzunehmen oder mit hülfreicher
Hand einzugreifen, wo etwas nicht paßte.
Um sieben Uhr erwarteten die Ordonnanzen in schwarzen
Kellnerfräcken die Festteilnehmer, und es währte keine halbe Stunde,
bis die Herren und Familien des Offizierkorps mit ihren Gästen
vollzählig erschienen waren.
Es bot ein buntes, farbenprächtiges Bild, wie sie alle in ihren mehr
oder minder geschmackvollen originellen Verkleidungen
durcheinanderwogten, während die Musik aus den verschiedenen
Ecken des Festplatzes ihre Tanzweisen ertönen ließ. Dabei floß der
Sekt in Strömen, und an einem Gartentische sah man sogar einen
derben Bauern, den Knotenstock zwischen den Beinen, eine Portion
Kaviar verzehren, während daneben ein Zirkusklown einen Hummer
zerlegte.
Die drolligste Figur aber war der Kommandeur in seinem polnischen
Bauernkostüm, mit der Pelzkappe auf dem Kopf. Wäre er in dieser
Verkleidung auf dem Schweinemarkt in Pommern erschienen, hätte
jeder Käufer einen bedeutenden Borstentier-Züchter in ihm
vermutet, mit dem es sich lohnte, einen Handel anzufangen. Es
machte ihm sichtlich auch keine Mühe, durch entsprechende
Gebärden und Bewegungen die Treue seiner Rolle zu erhöhen.
Da der Sekt auf allgemeine Unkosten ging, war der Herr Oberst
schon nach einer Stunde »veilchenblau«.
Sein hoher Adjutant hatte nicht gut daran getan, die Verkleidung
eines polnischen Juden zu wählen, denn auf diese Weise ersetzte er
geschickt, was seinem Äußeren am waschechten Mauschel noch
fehlte.
Frau König sah als Kammerzofe reizend aus, und ihre blauen Augen
strahlten vor Vergnügen. Wäre es im Ernst gewesen, so hätte die
niedliche blonde Dirn mit dem lebensfrohen frischen Gesichtchen
sofort eine Stellung mit hohem Lohn gefunden. Dies erkannte auch
der Jägerbursch, dessen Züge denen Bleibtreu's auffallend ähnlich
waren, und er beschloß, mit dem sauberen Mädel »zu gehen«, um
sich dann mit ihm zum Standesamt zu begeben. Erst das Ende des
Festes machte einen Strich durch die so schönen »Flitterstunden«
des jungen Paares und führte ihm die rauhe Wirklichkeit in Gestalt
des zum Aufbruch mahnenden Gatten vor Augen.
Auch Frau Leimann erschien als Vierländerin nicht minder
begehrenswert. Das Kostüm stand ihr gut, und Borgert weidete sich
mit sichtlichem Behagen an der schönen Figur und den kleinen
Füßchen seiner Hausgenossin.
Frau Kahle kokettierte als Blumenmädchen mit den jüngeren Herren,
indem sie aller Augen auf den Ausschnitt ihres Kleides zog, an
welchem sie eine herrliche Rose befestigt hatte. Auch sie spielte ihre
Rolle vortrefflich, denn der Sekt ließ bereits eine befriedigende
Wirkung erkennen. Leutnant Kolberg als Modegigerl hatte ihr bereits
alle Blumen abgekauft und sie dann als »Arbeitslose« gänzlich mit
Beschlag belegt.
Frau Rittmeister Stark allein paßte gar nicht in das Milieu des
Festplatzes hinein. Die Wahl ihrer Gewandung hatte ihr heftiges
Kopfzerbrechen verursacht, denn als Blumenmädchen oder
Balletteuse zu erscheinen, schien ihr zu gewagt. Die Rolle einer
Äpfel- oder Butterfrau fürchtete sie als zu naturgetreu, und so
schwebte sie denn in einem schillernden Phantasiekostüm durch die
Menge, das sie auf Befragen neckisch für das einer »Nixe in
mittleren Jahren« erklärte. So hatte sie sich in eine Wolke rosa und
mattgrüner Spitzen gehüllt, und der gewaltige Busen schien die
Meereswogen darzustellen, während die bloßen Arme eigentlich
mehr den Eindruck machten, als seien sie das Handwerkszeug einer
»Kraftmenschin« oder Riesendame.
Drei jüngere Herrn bildeten ein vortreffliches Vagabunden-Kleeblatt,
und man konnte glauben, die zerlumpten Gesellen hätten sich
meuchlings von der Landstraße eingeschlichen, um einmal ein Fest
der »oberen Zehntausend« mitzumachen. Die zu ihrer Rolle
passende Trunkenheit hatten sie sich in kürzester Zeit angeeignet.
Leutnant von Meckelburg stand als Leierkastenmann unbeweglich in
einer Ecke und konnte sich nicht entschließen, an dem lustigen
Treiben teilzunehmen, dabei machte er ein Gesicht, welches nicht
unmittelbar auf die Anwesenheit von Geist schließen ließ. Erst als er
in späterer Stunde seine musikalische Dekoration in einem Winkel
des Festplatzes verborgen, stellte sich allmählich etwas Geist ein, der
aber dem Grunde einer geleerten Sektflasche entstammte.
Die Musik spielte die schönsten Tanzweisen und benutzte die Pausen
zu intensivem Studium des Bierfasses, dessen Hahn aus dem
Tannengrün ihres Podiums herauslugte.
Um 11 Uhr begann die Festvorstellung auf der kleinen dazu
errichteten Bühne.
Ein Leutnant trug als Einleitung zwei prinkelnde Kouplets vor, indem
er als anmutige Chansonette in einem reichlich dekolletierten
Babykleidchen auf der Bühne herumhüpfte. Daran schloß sich die
Aufführung einer Parodie auf Shakespeares »Hamlet«, in deren
Verlauf sämtliche Mitwirkende durch Mord, Gift, Blitz, Hunger und
Durst elendiglich zu Grunde gehen. Zum Schluß trat sogar der
Souffleur auf die Bretter und gab, erschüttert durch die vor seinen
Augen sich abspielenden Greuel, seinem inhaltlosen Leben durch
freiwilligen Sturz in die Versenkung einen würdigen Abschluß.
So war die Stimmung immer anregender geworden und allmählich
unterschied sich die Fastnachtsfeier des Offizierkorps nur noch durch
den immer noch strömenden Sekt von dem Treiben auf einem
wirklichen Festplatz zur Zeit der Dorfkirmes.
Leutnant Kolberg hatte sich inzwischen mit Frau Rittmeister Kahle in
einer Laube niedergelassen und eine Rollschutzwand davorgestellt,
um ungestört und ungesehen ein trautes Stündchen zu verbringen.
Eine kleine »Flirtation« war ihm Lebensbedürfnis, und, da die
Garnison mit ihren soliden Bürgerstöchtern und ehrbaren Frauen
seinen diesbezüglichen Ansprüchen nicht gerecht wurde, wollte er
einmal hier sein Heil versuchen. Er wußte ja von Pommer her, wes
Geistes Kind Frau Grete war und wollte nun auf diplomatischem
Wege das Feld sondieren.
Die dazu erforderliche Zeit aber hatte er zu lange bemessen, denn
schon nach einer Viertelstunde lag die kleine Frau wonne- und
liebestrunken in seinen Armen und wehrte sich nicht im Geringsten,
als der feurige Galan die Rose am Busen seiner neuen Geliebten
einer eingehenden Besichtigung unterzog.
Das war doch ein anderer Kerl wie sein unbeholfener Vorgänger, der
hatte Mut und Feuer, und sie malte sich ein Liebesleben mit dem neu
eroberten Romeo in den glänzendsten Farben.
In einer anderen Laube saß Oberleutnant Leimann ganz allein und
vergoß Bäche von Tränen. Das heulende Elend hatte ihn wieder
pünktlich nach dem sechsten Glase gepackt.
Jeden tröstlichen Zuspruch wies er schroff zurück, und die
Ordonnanzen wollten sich tot lachen, wenn sie den heulenden
ungarischen Magnaten wie ein Häuflein Unglück auf einem Weinfaß
sitzen und herzbewegend schluchzen sahen.
Seine Gattin fand die Situation höchst langweilig und beschloß daher,
einen Migräneanfall zu bekommen. Sie nahm also mit müden Zügen
in einer anderen Ecke Platz und bat den sofort hinzukommenden
Borgert, sie nach Hause zu bringen.
Durch diesen Auftrag nicht unangenehm berührt, bot er der schönen
Vierländerin den Arm, geleitete sie zur Garderobe, warf ihr den
Pelzmantel über die Schultern und geleitete sie nach Hause.
Als sie vor der Tür des gemeinsamen Hauses standen, tat sie einen
tiefen Seufzer und sagte leise:
»Die Luft hat mir gut getan! Es ist mir wieder wohl!«
»Also darf ich Sie wieder zum Kasino zurückbegleiten?« war
Borgert's Antwort, und der Ton seiner Stimme verriet sichtliche
Enttäuschung.
»Ach nein, wir wollen bei mir noch eine Tasse Kaffee trinken, das
wird uns gut tun, ich habe auch gar keine Lust, wieder unter diese
betrunkenen Menschen zu gehen, es ist ein widerwärtiger Anblick!«
»Ganz wie Sie wünschen, meine Gnädigste!«
Dabei schob er den Schlüssel in das Schloß, öffnete die Tür, und
beide stiegen schweigend die dunkle Treppe hinauf.
Als sie im Zimmer angelangt waren, holte Borgert die Lampe herbei
und zündete sie an. Er kannte genau den Platz, wo sie zu finden war.
Dann griff er nach einer Zeitung und setzte sich träge in die
Sofaecke.
Frau Leimann aber war im Nebenzimmer verschwunden, um nach
wenigen Augenblicken wieder mit der Kaffeemaschine zu erscheinen,
auch hatte sie das Fastnachtskostüm mit dem Morgenrock
vertauscht, dessen weicher Faltenwurf sich kosend an die schönen
Glieder schmiegte.
»So,« sagte sie, die Gardinen zuziehend, »jetzt sind wir endlich in
unseren vier Pfählen, jetzt wollen wir noch ein Stündchen gemütlich
plaudern!«
Dabei ließ sie sich ebenfalls auf das Sofa fallen, und Borgert's Augen
hingen wie trunken an der jugendlich schönen Gestalt, die sich unter
dem Stoff des Gewandes verriet.
»Endlich allein! könnte man eigentlich sagen,« scherzte Borgert,
»hoffentlich kommt Ihr Gatte nicht zu bald nach, damit unser
idyllisches Kaffeestündchen nicht gestört wird.«
»Mein Mann?« erwiderte Frau Leimann mit spöttisch
emporgezogenen Lippen, »der kann bleiben wo er ist, wie ich ihn
kenne, kommt er vor morgen früh auch nicht nach Hause. Ich habe
den Menschen schrecklich satt! Ich kann ja zu Ihnen offen reden!«
»Ja, gnädige Frau, das sind eben die Freuden und Leiden des
Ehestandes. Drum prüfe, wer sich ewig bindet, sagt Schiller, denn
sonst gibt es eben ein Unglück!«
»Sie haben gut reden! Man kann doch in den paar Wochen, die man
verlobt ist, nicht seinen Zukünftigen so kennen lernen, wie man es in
der Ehe tut. Hätte ich das gekonnt, dann hätten wir nicht diese
Dummheit begangen, uns zu heiraten. Denn ich bin ihm jetzt zu arm
und er wird mir allmählich unausstehlich!«
»Darum heirate ich nie, ich lasse die Finger von diesem
Hazardspiel!«
»Aber man ist doch schließlich dazu da!« erwiderte Frau Leimann
fast gereizt, »man will doch später nicht als alte Jungfer zum
Gespött der Leute werden.«
»Nach unseren Gesetzen und gesellschaftlichen Regeln hilft es eben
nichts, gnädige Frau, da heißt es entweder heiraten oder ledig
bleiben. Aber das ist entschieden eine Lücke in unserer
Weltordnung. Wie wenige sind es, die, nach langjähriger Ehe vor die
Frage gestellt, ob sie sich noch einmal heiraten würden, mit einem
aufrichtigen »Ja« antworten könnten! Meistens würde man doch die
Gelegenheit benutzen, auseinander zu laufen. Ich setze dabei also
voraus, daß es eine Bestimmung gäbe, die nach beispielsweiser
zehnjähriger Ehe diese trennen und den Gatten eine nochmalige
gegenseitige Heirat gestatten würde.«
»Sie haben Recht, manche möchten schon nach den ersten Wochen
wieder auseinander, aber sie müssen weiter neben einander her
vegetieren, weil sie durch die sogenannte Ehe zusammengebunden
sind.«
»Das wäre etwas voreilig gehandelt, gnädige Frau, denn viele
Ehegatten müssen sich erst an einander abschleifen und ganz genau
kennen, um sich schätzen zu lernen, wozu oft lange Jahre gehören,
und dann kommt es doch häufig vor, daß sie in späteren Jahren
recht gut miteinander auskommen, während sie früher wie Hund
und Katze standen.«
»Gewiß, aber wenn nach zehn Jahren keine Liebe da ist, dann
kommt sie auch nicht mehr!«
»Das möchte ich beinahe auch glauben,« lachte Borgert, »man sieht
eben, die Ehe ist keine zeitgemäße Einrichtung. Sie mag gut sein für
zwei Menschenkinder, die äußerer Vorteile wegen, wie sie auch sein
mögen, sich heiraten. Aber für Menschen, die nur
zusammenkommen, weil sie glauben, sie lieben sich, ist es nichts,
denn wenn die Liebe vorbei ist, ist die Ehe nur ein Martyrium. Und
deswegen sollte es für solche, die sich näher treten wollen, eine
andere Einrichtung geben, als sie dann gleich fürs ganze Leben
aneinander zu fesseln!«
»Sie meinen also dann, an Stelle der Ehe sollte man die sogenannte
»freie Liebe« einführen?«
»Gewiß, gnädige Frau, entweder das, oder, wenn dies aus irgend
welchen Gründen nicht ratsam erscheinen sollte, eine Einrichtung
schaffen, wie sie die Orientalen haben. Hat dort ein Mann sich an
einer Frau gesättigt, wenn ich mich drastisch ausdrücken soll, so
geht er einfach zur nächsten über, denn er darf sich ein ganzes Hans
voll halten. Aber er wird einer einzelnen gar nicht so schnell
überdrüssig, weil er eben Abwechslung in der Liebe haben kann.
Und man kann doch keinen Menschen zwingen, sein ganzes Leben
nur immer denselben oder dieselbe zu lieben!«
»Da schiene mir denn doch die freie Liebe noch ratsamer, wenn Sie
einmal die Einzelehe verwerfen wollen, denn sie wäre noch weniger
durch Grenzen und Gesetze beengt, wie es die orientalische Ehe
trotzdem ist.«
»Selbstverständlich, welchen Unsinn und widernatürlichen Zwang
unsere Ehe bedeutet, sehen Sie, wenn Sie ihr Wesen einmal genau
definieren. Was heißt Ehe? Ein Bündnis zwischen Mann und Frau, die
sich lieben oder deren äußere Verhältnisse eine Verbindung ratsam
erscheinen lassen. Dabei machen Kirche und Gesetz, manchmal auch
nur letzteres allein, dieses Bündnis, Ehe genannt, zu einem
rechtmäßigen.
Aber erstens: die sich lieben. Tun sie das immer und dann durch das
ganze Leben? Nein, nur in der Minderzahl der Fälle bleibt eine etwa
zu Anfang vorhandene Liebe bestehen, aber die Ehe ist von Gott und
Natur dazu bestimmt, Liebende zu verbinden. Tut sie das nicht, ist es
Unsinn.
Zweitens: eine Ehe zwischen äußeren Umständen gibt es auch nicht,
denn um aus gemeinsamen Vorteilen, oder wie Sie es nennen
wollen, Gewinn zu haben, ist Handel und Geschäft der richtige Weg,
aber nicht die heilige Ehe.
Drittens: eine Ehe, in welcher die Liebe schwinden kann, ist ebenfalls
hinfällig, denn man muß bei der Trauung dem Pfarrer,
gewissermaßen also dem Stellvertreter Gottes, das eidliche
Versprechen geben: wir wollen uns das ganze Leben in Liebe
angehören. Dieser Eid ist also sofort in einen Meineid verwandelt,
wenn die Liebe schwindet. Und wie kann man mich denn zwingen,
etwas zu schwören, von dem ich noch gar nicht weiß, ob ich es zu
halten im stande bin? Wider die Natur kann doch kein Mensch!
Der Begriff Ehe ist also abgetan.
Was haben nun weiter Gesetz und Kirche mit der Verbindung zweier
Menschen zu tun, die sich lieben? Die Kirche gibt ihren Segen dazu
und soll den Bund heiligen. Das ist aber überflüssig und lediglich
eine Formsache, denn das Gefühl der Weihe, wie es die Trauung
einflößen soll, haben zwei Menschen von selbst, die sich wirklich
gern haben und den Entschluß fassen, sich zu verbinden.
Ferner, ein Gesetz muß es ja geben, denn es bildet die Norm für
auseinandergehende Ansichten, und ohne Gesetz ist kein Staat, kein
gemeinschaftliches Wirken zweier oder mehrerer Menschen denkbar.
Die Liebe als solche aber, wie sie allein zwei Gatten zusammenführen
soll, braucht keine Gesetze, denn diese sind von der Natur
aufgestellt. Ein Gesetz schreibt Handlungen oder Unterlassungen vor,
gibt Anhaltspunkte für das menschliche Zusammenleben und
Wirken, Gefühle aber kann es nicht vorschreiben, also auch nicht
rechtskräftig machen.
Zwei Menschen also, die sich wirklich lieben und fühlen, daß sie
zusammen gehören, verbinden sich am natürlichsten durch die freie
Liebe!«
»Aber warum sollen sie sich denn nicht heiraten, wenn sie unbedingt
glauben, zusammen zu gehören?« warf Frau Leimann ein.
»Weil sie der Kirche keinen falschen Eid geschworen haben, wenn
die Liebe einmal schwindet, auch können sie dann ruhig wieder
auseinander gehen.«
»Aber dafür gibt es doch die Scheidung!«
»Gewiß, die gibt es. Eine Scheidung aber wirbelt meist so viel Staub
auf und hat oft so nachteilige Folgen für die Beteiligten, daß sie
lieber jahrelang in gegenseitigem Überdruß, oder gar in Haß und
Verachtung neben einander leben, als sich zur Scheidung
entschließen. Abgesehen von den großen gesetzlichen
Schwierigkeiten einer solchen ist es aber auch meist schwer, die nun
einmal verbundenen äußeren Umstände, Vermögen u. s. w. zu
trennen.
Hört freie Liebe auf, so geht man stillschweigend wieder auseinander
und führt nicht jahrelang ein widernatürliches Leben in einer
sogenannten Ehe. Auch werden sich Mann und Frau, solange wahre
Liebe zu einander vorhanden ist, nicht gegenseitig mit einem
anderen betrügen, und damit wäre viel Unglück und Sünde aus der
Welt geschafft.«
»Aber dann müßte ja jeder gesellschaftliche Familienverkehr
aufhören, denn die Männer eines gemeinsamen Wirkungskreises, z.
B. eines Offizierkorps oder die Beamten eines Gerichtes würden
dann aus so verschiedenen Schichten der Gesellschaft oder des
Volkes ihre Frauen wählen, daß diese gar nicht zusammen passen
würden!«
»Das wäre kein Hinderungsgrund, gnädige Frau: die zu einander
passen, könnten doch miteinander verkehren. Die übrigen bleiben
sich eben gegenseitig fremd. Oder finden Sie es etwa schön, daß
Frauen, die sich innerlich ganz fern stehen und bleiben, jeden Tag
wie dicke Freundinnen zusammensetzen, weil es der
gesellschaftliche Verkehr verlangt?«
»Das finde ich allerdings nicht schön, man braucht sich ja nur einmal
unsere Damenkaffees zu betrachten.«
»Die Wahl der Frau in der freien Liebe ist an keine
Gesellschaftsklasse gebunden, weil dann die Frau dem Manne eben
nicht dazu dient, sich äußere Vorteile in Stellung oder pekuniärer
Beziehung zu schaffen oder um mit ihr Staat zu machen, sondern
nur für die Liebe, also für das engere Leben in Haus und Familie.«
»Aber die Ehe ist doch eigentlich nur die Form für ein Naturgesetz,
daß nämlich das Menschengeschlecht erhalten wird.«
»Stimmt, aber dieses Naturgesetz wird weit besser durch die freie
Liebe als durch die Ehe gefördert. Nehmen Sie eine Ehe, in welcher
die wirkliche Liebe der Gatten zu einander geschwunden ist, oder sie
sich vielleicht sogar überdrüssig sind. Scheiden lassen wollen sie sich
nicht, aber Kinder werden doch in die Welt gesetzt, eins nach dem
anderen. Diese aber sind keine Kinder der Liebe, und ihre Erziehung,
Charakter- und Gemütsbildung muß doch darunter leiden, wenn sie
keine inneren Beziehungen, keine Herzens- und
Seelenverwandschaft der Eltern empfinden, denn dahinter kommt
ein Kind sehr bald. Aber auch die Kinderzahl würde sich in der freien
Liebe verringern, denn ein Mann, der seine Frau wirklich lieb hat,
macht keine Maschine aus ihr, und glauben Sie nicht, daß zum Glück
einer Ehe schon zwei Kinder genügen? Jedes weitere bringt nur Last
und Sorge. Wenn aber, besonders in niederen Volksklassen, die
Kinderzahl abnimmt, ist auch gleichzeitig eines jener Grundübel
beseitigt, die den Sozialismus fördern.«
»Nun nehmen Sie aber eine Ehe, die fünf Kindern das Leben gibt
und setzen Sie statt der Ehe die freie Liebe: Der Mann wählt jedes
Jahr eine andere Frau, das lassen Sie zwanzig Jahre so fortgehen
und es gibt unter normalen Umständen zwanzig Kinder statt fünf.
Was soll aus ihnen werden? Der Mann kann doch nicht jedesmal in
sein neues Liebesverhältnis die jährlich wachsende Kinderzahl
mitbringen und sie alle großziehen!«
»Betreffs der Kinder der freien Liebe könnte es ja ein Gesetz geben,
welches dem Vater dieselben Verpflichtungen auferlegt, wie sie für
außereheliche Kinder bestehen. Dann würde er sich schon
einzurichten wissen, wenn er zu regelmäßigen, seinem Einkommen
entsprechenden Geldopfern gezwungen wäre.«
»Und wenn der zweiten Frau nicht paßt, daß er das Kind des ersten
Verhältnisses mitbringt?«
»Dann könnte man Erziehungshäuser in großem Styl errichten.
Schon unter den jetzigen Verhältnissen wäre es oft gut, wenn ein
Kind nicht bei den Eltern aufwüchse, die nicht harmonieren, und so
dem jugendlichen Gemüt Eindrücke zu teil werden, die ihm nicht von
Nutzen sind.
Indeß nennt man ja Kinder das Unterpfand der Liebe, sie würden
das einmal eingegangene Verhältnis erhalten helfen.«
»Dann kämen wir also wieder auf die Ehe zurück!«
»Gewiß, aber auf eine Ehe, die wir jeden Tag selbständig lösen
dürfen.
Wir Menschen tun gut, uns in allem an die Natur zu halten, an ihr
künsteln und bessern zu wollen, hat meist den entgegengesetzten
Erfolg. Ein Tier tritt auch nicht vor den Altar oder den
Standesbeamten, wenn es sich mit einem anderen paaren will. Sind
sie von einander gesättigt, läuft das eine wieder nach Süden, das
andere nach Norden.«
»Wir sind aber doch mehr wie Tiere!« lachte Frau Leimann.
»Dafür haben wir auch die Liebe, ein Tier kennt nur Triebe!«
Frau Leimann schwieg. Ein so ernstes Gespräch hatte sie lange nicht
geführt und es machte ihr fast Mühe, dem Gedankengang zu folgen.
Schien ihr auch mancher Punkt noch anfechtbar, im Grunde war es
doch richtig mit dieser freien Liebe, und sie bedauerte beinahe, daß
man in der Kultur noch nicht so weit gekommen sei. Das wäre eher
nach ihrem Geschmack gewesen, als die Ehe mit so einem
langweiligen, häßlichen Mann, wie ihr Gatte war, mit so unendlich
vielen schlechten Eigenschaften. Sie besaß auch genügend
Feingefühl, um mit dem schlauen Verstand einer Frau zu empfinden,
wo hinaus Borgert mit Entwickelung dieser seiner Ansichten wollte.
Sie warf daher ihr erhitztes Köpfchen auf, blinzelte verschmitzt den
Apostel der freien Liebe von der Seite an und fragte mit erheuchelter
Unbefangenheit:
»Nun, sagen Sie, wenn eine Frau schon verheiratet ist, also bereits
durch eine Gesetzesehe gebunden, und kommt nun nachträglich zur
Einsicht, daß die freie Liebe besser ist? Was dann?«
»Dann mag sie ihrer Einsicht folgen, nur darf sie es nicht so
offenkundig vor aller Augen tun, da sie es eben nach den vorläufig
noch bestehenden Grundsätzen über eheliche Treue nicht darf. Sie
muß es machen wie die Pariserin.«
»Dann wird es aber Zeit, daß ich mich nach einem solchen
heimlichen Romeo umsehe, denn mein Gesetzlicher wird mir
allmählich unheimlich!« rief Frau Leimann belustigt.
»Kann ich Ihnen dabei behilflich sein, Gnädigste?« entgegnete
Borgert ebenfalls scherzend.
»Sie würden es sich damit wahrscheinlich wieder leicht machen,
denn, wenn ich mich recht entsinne, stellten sie sich schon einmal
freundlichst zur Verfügung!«
»Womit ich auch in diesem Falle meine Dienste beginnen würde!«
»Dann könnte ich ja mit Ihnen einmal die neue Theorie probieren,
schade, daß kein heimlicher Standesbeamter da ist. Aber nein, den
haben Sie ja als überflüssig verworfen.«
»Nein, den brauchen wir nicht, wir machen die Sache unter uns ab!«
sagte Borgert scherzend.
»Bedarf es denn gar keiner Formalitäten?«
»Gewiß, sogar vieler, und zwar derselben wie beim Abschluß einer
richtiggehenden Ehe!«
»Ach so, Sie meinen einen Händedruck und einen innigen,
tränenfeuchten Blick?«
»Auch das gehört dazu.«
»Auch? Was denn noch? Ich habe so ein schlechtes Gedächtnis.«
»Ich will es Ihnen ins Ohr sagen, rücken Sie etwas näher!«
Frau Leimann rückte dicht neben Borgert und sagte, unbefangen
scherzend:
»Das scheint ja eine große Heimlichkeit zu sein!« Sie beugte ihren
Kopf zu Borgert hin, welcher in diesem Augenblick mit beiden Armen
die schöne Frau umschlang, während seine Lippen die ihren suchten.
Da schlang auch sie die Arme um den Mann, und lange hielten sie
sich so umschlungen, während ein heißer, glühender Kuß all die
verhaltenen Gefühle der Liebe auszuströmen schien, die lange beider
Herzen erfüllt.
Die Lampe war schon im Erlöschen begriffen, als ein unsicherer,
schwerer Schritt auf der Treppe vernehmbar ward.
»Er kommt!« stieß Frau Leimann erschrocken aus, »Du mußt dich
eilen, daß er dich nicht hört!«
Eine letzte Umarmung, und Borgert huschte durch das Speisezimmer
dem anderen Ende des Korridors zu, um über die Hintertreppe nach
seiner im Erdgeschoß gelegenen Wohnung zu gelangen. An der Tür
aber zog er behend die Schuhe aus und tappte leise die dunkle
Treppe hinab.
Frau Leimann aber blies die Lampe aus, stellte Borgerts Kaffeetasse
unter das Sopha und legte sich wie schlafend in die weichen Kissen
zurück.
Inzwischen hatte Leimann geräuschvoll die Korridortür geöffnet und
trat jetzt in das Zimmer, wo die Gattin seiner harrte.
Einen Augenblick blieb er am Eingang stehen. Roch es hier nicht
nach Zigarettenrauch? Dann tastete er mit den Händen nach dem
Tisch, ergriff die Streichholzschachtel und zündete eine Kerze an. Da
erblickte er seine Gattin auf dem Sofa.
Der Anblick rührte ihn. Hatte die treue Seele auf ihn gewartet, um
ihm noch eine Tasse Kaffee anzubieten? Gewiß war sie vor Müdigkeit
entschlummert und hörte ihn nicht, als er nach Hause kam. So trat
er denn behutsam an das Sofaende und küßte seine Frau auf die
Stirn.
Mit einem leichten Schrei fuhr sie empor.
»Ach du bist es, Georg, wo bleibst du so lange?«
»Sei mir nicht böse, mein Engel, daß ich dich warten ließ, aber ich
ahnte ja nicht, daß du meinetwegen aufbleiben würdest. Warum
hast du dich nicht gelegt?«
Aus den Worten klang ein liebevoller Ton, sie schienen wie eine
Entschuldigung, eine Bitte um Verzeihung; Frau Leimann aber
wischte sich den Schlaf aus den Augen und erhob sich müde.
»Ich mußte doch auf dich warten, Georg, du warst wieder in einem
schrecklichen Zustand. Als ich dich so sitzen sah, wurde mir so
elend, daß ich es nicht mehr aushalten konnte, und ging nach
Hause!«
»Allein, so spät, in der Nacht? Warum hast du dich nicht von einer
Ordonnanz begleiten lassen?«
»Borgert hat mich bis an die Tür gebracht, er bot mir seine
Begleitung an!«
»Dafür muß ich mich morgen bei ihm bedanken, er ist überhaupt
immer sehr aufmerksam gegen dich! Wo ist er denn geblieben, ich
habe ihn nicht mehr gesehen den ganzen Abend!«
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
More than just a book-buying platform, we strive to be a bridge
connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.
Join us on a journey of knowledge exploration, passion nurturing, and
personal growth every day!
ebookbell.com

Weitere ähnliche Inhalte

PDF
Ibm Tivoli Monitoring Version 51 Advanced Resource Monitoring Ibm Redbooks
PDF
Programming Logic and Design Comprehensive 6th Edition Joyce Farrell
PDF
Visualisierung von Algorithmen und Datenstrukturen
PDF
HTML5 und CSS3 Übersicht
PDF
Introducing Microsoft Sql Server 2008 R2 Ross Mistry And Stacia Misner
PDF
Vergleich des Scala Web-Frameworks Lift mit dem Java EE Programmiermodell
PDF
Master thesis pascal_mueller01
PDF
Diplomarbeit
Ibm Tivoli Monitoring Version 51 Advanced Resource Monitoring Ibm Redbooks
Programming Logic and Design Comprehensive 6th Edition Joyce Farrell
Visualisierung von Algorithmen und Datenstrukturen
HTML5 und CSS3 Übersicht
Introducing Microsoft Sql Server 2008 R2 Ross Mistry And Stacia Misner
Vergleich des Scala Web-Frameworks Lift mit dem Java EE Programmiermodell
Master thesis pascal_mueller01
Diplomarbeit

Ähnlich wie Rational Application Developer V6 Programming Guide 2 Volume Set Ibm Redbooks (20)

PDF
Dreamweaver cs5 hilfe
PDF
Application Integration Eai B2b Bpm And Soa 1st Edition Bernard Manouvrier
PDF
Getting Started With Angular 2nd Edition Stephen Adams
PDF
Groups 2010.02: Offenheit des Android-Betriebssystems (Digital Sustainability)
PDF
Reconfigurable System Design and Verification 14 1st Edition Pao-Ann Hsiung
PDF
Mocek Thesis
PDF
Sappres Netweaver Identity Management
PDF
Handbuch
PDF
Algorithmen und Applikationen zur interaktiven Visualisierung und Analyse ch...
PDF
Seminarkatalog
PDF
Final Opentrans 2.0 Rfq
PDF
382726314 X Php5 In 14 Tagen (Ddt)
PDF
Evaluierungsmodell
PDF
Evaluierungsmodell
PDF
Handbuch CONSIDEO Modeler V 5.0
PDF
Elektronischer Geschäftsverkehr in Mittelstand und Handwerk 2010 - Ergebniss...
PDF
Microsoft Sql Server 2000 Database Design Not Available Na
PDF
[DE] Dr. Ulrich Kampffmeyer - Artikel auf Wikipedia | 2015
PDF
Handbuch de
PDF
SITEFORUM Tutorial v7
Dreamweaver cs5 hilfe
Application Integration Eai B2b Bpm And Soa 1st Edition Bernard Manouvrier
Getting Started With Angular 2nd Edition Stephen Adams
Groups 2010.02: Offenheit des Android-Betriebssystems (Digital Sustainability)
Reconfigurable System Design and Verification 14 1st Edition Pao-Ann Hsiung
Mocek Thesis
Sappres Netweaver Identity Management
Handbuch
Algorithmen und Applikationen zur interaktiven Visualisierung und Analyse ch...
Seminarkatalog
Final Opentrans 2.0 Rfq
382726314 X Php5 In 14 Tagen (Ddt)
Evaluierungsmodell
Evaluierungsmodell
Handbuch CONSIDEO Modeler V 5.0
Elektronischer Geschäftsverkehr in Mittelstand und Handwerk 2010 - Ergebniss...
Microsoft Sql Server 2000 Database Design Not Available Na
[DE] Dr. Ulrich Kampffmeyer - Artikel auf Wikipedia | 2015
Handbuch de
SITEFORUM Tutorial v7
Anzeige

Rational Application Developer V6 Programming Guide 2 Volume Set Ibm Redbooks

  • 1. Rational Application Developer V6 Programming Guide 2 Volume Set Ibm Redbooks download https://ebookbell.com/product/rational-application- developer-v6-programming-guide-2-volume-set-ibm-redbooks-2104608 Explore and download more ebooks at ebookbell.com
  • 2. Here are some recommended products that we believe you will be interested in. You can click the link to download. Building Applications With Ibm Rational Application Developer And Javabeans 1st Edition Colette Burrus Stephanie Parkin https://ebookbell.com/product/building-applications-with-ibm-rational- application-developer-and-javabeans-1st-edition-colette-burrus- stephanie-parkin-36650514 Learning Postgresql Create Develop And Manage Relational Databases In Real World Applications Using Postgresql 1st Edition Juba https://ebookbell.com/product/learning-postgresql-create-develop-and- manage-relational-databases-in-real-world-applications-using- postgresql-1st-edition-juba-5313886 Polynomial And Rational Matrices Applications In Dynamical Systems Theory 1st Edition Tadeusz Kaczorek Auth https://ebookbell.com/product/polynomial-and-rational-matrices- applications-in-dynamical-systems-theory-1st-edition-tadeusz-kaczorek- auth-4192238 The Core Test Wrapper Handbook Rationale And Application Of Ieee Std 1500 1st Edition Francisco Da Silva https://ebookbell.com/product/the-core-test-wrapper-handbook- rationale-and-application-of-ieee-std-1500-1st-edition-francisco-da- silva-4191612
  • 3. Bounded Rational Choice Behaviour Applications In Transport Rasouli https://ebookbell.com/product/bounded-rational-choice-behaviour- applications-in-transport-rasouli-22052404 Noncommutative Rational Series With Applications Encyclopedia Of Mathematics And Its Applications 1st Edition Jean Berstel https://ebookbell.com/product/noncommutative-rational-series-with- applications-encyclopedia-of-mathematics-and-its-applications-1st- edition-jean-berstel-2323590 Homotopy Of Operads And Grothendieckteichmuller Groups Part 2 The Applications Of Rational Homotopy Theory Methods Benoit Fresse https://ebookbell.com/product/homotopy-of-operads-and- grothendieckteichmuller-groups-part-2-the-applications-of-rational- homotopy-theory-methods-benoit-fresse-10833004 Rational Bases And Generalized Barycentrics Applications To Finite Elements And Graphics 1st Edition Eugene Wachspress Auth https://ebookbell.com/product/rational-bases-and-generalized- barycentrics-applications-to-finite-elements-and-graphics-1st-edition- eugene-wachspress-auth-5353948 Rational Choice And Social Welfare Theory And Applications Essays In Honor Of Kotaro Suzumura 1st Edition Maurice Salles Auth https://ebookbell.com/product/rational-choice-and-social-welfare- theory-and-applications-essays-in-honor-of-kotaro-suzumura-1st- edition-maurice-salles-auth-4398702
  • 5. ibm.com/redbooks Rational Application Developer V6 Programming Guide John Ganci Fabio Ferraz Hari Kanangi Kiriya Keat George Kroner Juha Nevalainen Nicolai Nielsen Richard Raszka Neil Weightman Develop Java, Web, XML, database, EJB, Struts, JSF, SDO, EGL, Web Services, and portal applications Test, debug, and profile with built-in and remote servers Deploy applications to WebSphere Application Server and WebSphere Portal Front cover
  • 7. Rational Application Developer V6 Programming Guide June 2005 International Technical Support Organization SG24-6449-00
  • 8. © Copyright International Business Machines Corporation 2005. All rights reserved. Note to U.S. Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. First Edition (June 2005) This edition applies to IBM Rational Application Developer V6.0 and IBM WebSphere Application Server V6.0. Note: Before using this information and the product it supports, read the information in “Notices” on page xxi.
  • 9. © Copyright IBM Corp. 2005. All rights reserved. iii Contents Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii The team that wrote this redbook. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii Become a published author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvi Comments welcome. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxvii Summary of changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxvii June 2005, First Edition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxvii Part 1. Introduction to Rational Application Developer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Chapter 1. Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1 Introduction and concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.1.1 IBM Rational Software Development Platform . . . . . . . . . . . . . . . . . . 4 1.1.2 Version 6 terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.1.3 Application development challenges. . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.1.4 Key themes of Version 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.2 Product packaging. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.2.1 Rational Developer supported platforms and databases . . . . . . . . . . 9 1.2.2 Rational Application Developer V6 product packaging . . . . . . . . . . . 10 1.2.3 Rational Web Developer V6 product packaging . . . . . . . . . . . . . . . . 11 1.3 Product features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 1.3.1 Summary of new features in Version 6 . . . . . . . . . . . . . . . . . . . . . . . 14 1.3.2 Specification versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 1.3.3 Eclipse and IBM Rational Software Development Platform . . . . . . . 19 1.3.4 Test server environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 1.3.5 Licensing and installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.3.6 Migration and coexistence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 1.3.7 Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 1.4 Sample code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Chapter 2. Programming technologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.1 Desktop applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 2.1.1 Simple desktop applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 2.1.2 Database access. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 2.1.3 Graphical user interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 2.1.4 Extensible Markup Language (XML). . . . . . . . . . . . . . . . . . . . . . . . . 38 2.2 Static Web sites. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
  • 10. iv Rational Application Developer V6 Programming Guide 2.2.1 Hypertext Transfer Protocol (HTTP) . . . . . . . . . . . . . . . . . . . . . . . . . 40 2.2.2 HyperText Markup Language (HTML) . . . . . . . . . . . . . . . . . . . . . . . 42 2.3 Dynamic Web applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 2.3.1 Simple Web applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 2.3.2 Struts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 2.3.3 JavaServer Faces (JSF) and Service Data Objects (SDO) . . . . . . . 52 2.3.4 Portal applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 2.4 Enterprise JavaBeans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 2.4.1 Different types of EJBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 2.4.2 Other EJB features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 2.4.3 Requirements for the development environment . . . . . . . . . . . . . . . 61 2.5 J2EE Application Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 2.5.1 Application Programming Interfaces (APIs) . . . . . . . . . . . . . . . . . . . 63 2.5.2 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 2.5.3 Naming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 2.5.4 Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 2.5.5 Requirements for the development environment . . . . . . . . . . . . . . . 65 2.6 Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 2.6.1 Web Services in J2EE V1.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 2.7 Messaging systems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 2.7.1 Java Message Service (JMS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 2.7.2 Message-driven EJBs (MDBs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 2.7.3 Requirements for the development environment . . . . . . . . . . . . . . . 72 Chapter 3. Workbench setup and preferences . . . . . . . . . . . . . . . . . . . . . . 75 3.1 Workbench basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 3.1.1 Workspace basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 3.1.2 Rational Application Developer log files . . . . . . . . . . . . . . . . . . . . . . 83 3.2 Preferences. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 3.2.1 Automatic builds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 3.2.2 Clean build (manual) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 3.2.3 Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 3.2.4 File associations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 3.2.5 Local history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 3.2.6 Perspectives preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 3.2.7 Internet preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 3.3 Java development preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 3.3.1 Java classpath variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 3.3.2 Appearance of Java elements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 3.3.3 Code style and formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 3.3.4 Compiler options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 3.3.5 Java editor settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 3.3.6 Installed JREs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
  • 11. Contents v 3.3.7 Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 3.3.8 Code review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Chapter 4. Perspectives, views, and editors. . . . . . . . . . . . . . . . . . . . . . . 131 4.1 Integrated development environment (IDE) . . . . . . . . . . . . . . . . . . . . . . 132 4.1.1 Rational Application Developer online help. . . . . . . . . . . . . . . . . . . 132 4.1.2 Perspectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 4.1.3 Views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 4.1.4 Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 4.1.5 Perspective layout. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 4.1.6 Switching perspectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 4.1.7 Specifying the default perspective . . . . . . . . . . . . . . . . . . . . . . . . . 140 4.1.8 Organizing and customizing perspectives. . . . . . . . . . . . . . . . . . . . 140 4.2 Available perspectives. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 4.2.1 CVS Repository Exploring perspective . . . . . . . . . . . . . . . . . . . . . . 143 4.2.2 Data perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 4.2.3 Debug perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 4.2.4 Generic Log Adapter perspective . . . . . . . . . . . . . . . . . . . . . . . . . . 148 4.2.5 J2EE perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 4.2.6 Java perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 4.2.7 Java Browsing perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 4.2.8 Java Type Hierarchy perspective . . . . . . . . . . . . . . . . . . . . . . . . . . 155 4.2.9 Plug-in Development perspective . . . . . . . . . . . . . . . . . . . . . . . . . . 157 4.2.10 Profiling and Logging perspective . . . . . . . . . . . . . . . . . . . . . . . . . 158 4.2.11 Resource perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 4.2.12 Team Synchronizing perspective . . . . . . . . . . . . . . . . . . . . . . . . . 160 4.2.13 Test perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 4.2.14 Web perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 4.2.15 Progress view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 4.3 Rational Product Updater . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 Chapter 5. Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 5.1 J2EE architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 5.1.1 EAR files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 5.1.2 WAR files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 5.1.3 EJB JAR files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 5.1.4 J2EE Application Client JAR files . . . . . . . . . . . . . . . . . . . . . . . . . . 171 5.1.5 RAR files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 5.2 Projects and folders. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 5.3 Rational Application Developer projects . . . . . . . . . . . . . . . . . . . . . . . . . 173 5.3.1 Enterprise Application project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 5.3.2 J2EE Application Client project . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 5.3.3 Dynamic Web Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
  • 12. vi Rational Application Developer V6 Programming Guide 5.3.4 Static Web Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 5.3.5 EJB project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 5.3.6 Connector project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 5.3.7 Java project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 5.3.8 Simple project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 5.3.9 Server project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 5.3.10 Component test project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 5.3.11 Checkout projects from CVS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 5.4 Creating a new project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 5.5 Project properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 5.6 Rational Application Developer samples. . . . . . . . . . . . . . . . . . . . . . . . . 181 5.6.1 The samples gallery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 Part 2. Develop applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 Chapter 6. RUP and UML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 6.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 6.2 Rational Unified Process (RUP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 6.2.1 Process Advisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 6.2.2 Process Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 6.2.3 Setting process preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 6.3 Visualize applications with UML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 6.3.1 Unified Modeling Language (UML) . . . . . . . . . . . . . . . . . . . . . . . . . 195 6.3.2 Browse diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 6.3.3 Topic Diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 6.3.4 Static Method Sequence Diagram . . . . . . . . . . . . . . . . . . . . . . . . . 203 6.3.5 Class Diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 6.3.6 Sequence Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 6.3.7 J2EE visualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 6.4 More information on UML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 Chapter 7. Develop Java applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 7.1 Java perspective overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 7.1.1 Package Explorer view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 7.1.2 Call Hierarchy view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 7.1.3 Type Hierarch view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 7.1.4 Problems view. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 7.1.5 Declaration view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 7.1.6 Code review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 7.1.7 Outline view. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 7.1.8 Diagram Navigator view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 7.2 Develop the Java Bank application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 7.2.1 Java Bank application overview . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 7.2.2 Create a Java Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
  • 13. Contents vii 7.2.3 Create a class diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 7.2.4 Create Java packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 7.2.5 Create a Java interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 7.2.6 Create Java classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 7.2.7 Create the Java attributes and accessor methods . . . . . . . . . . . . . 254 7.2.8 Add method declarations to an interface. . . . . . . . . . . . . . . . . . . . . 258 7.2.9 Add Java methods and constructors. . . . . . . . . . . . . . . . . . . . . . . . 262 7.2.10 Define relationships (extends, implements, association) . . . . . . . 267 7.2.11 Implement the methods for each class . . . . . . . . . . . . . . . . . . . . . 270 7.2.12 Run the Java Bank application . . . . . . . . . . . . . . . . . . . . . . . . . . . 286 7.3 Additional features used for Java applications . . . . . . . . . . . . . . . . . . . . 286 7.3.1 Locating compile errors in your code . . . . . . . . . . . . . . . . . . . . . . . 287 7.3.2 Running your programs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 7.3.3 Debug your programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292 7.3.4 Java Scrapbook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 7.3.5 Pluggable Java Runtime Environment (JRE) . . . . . . . . . . . . . . . . . 296 7.3.6 Add a JAR file to the classpath . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 7.3.7 Export the Java code to a JAR file . . . . . . . . . . . . . . . . . . . . . . . . . 299 7.3.8 Run the Java application external to Application Developer . . . . . . 301 7.3.9 Import a Java JAR file into a project . . . . . . . . . . . . . . . . . . . . . . . . 301 7.3.10 Utility Java Projects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302 7.3.11 Javadoc. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 7.4 Java editor and Rapid Application Development. . . . . . . . . . . . . . . . . . . 311 7.4.1 Navigate through the code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311 7.4.2 Source folding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314 7.4.3 Type hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 7.4.4 Smart Insert. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 7.4.5 Mark occurrences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 7.4.6 Word skipping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317 7.4.7 Smart compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318 7.4.8 Java search. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318 7.4.9 Working sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 7.4.10 Quick Assist (Quick Fix) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320 7.4.11 Code Assist (content) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320 7.4.12 Import generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322 7.4.13 Generate getters and setters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324 7.4.14 Override/implement methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325 7.4.15 Adding constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326 7.4.16 Refactoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328 Chapter 8. Develop Java database applications . . . . . . . . . . . . . . . . . . . 333 8.1 Introduction to Java database programming . . . . . . . . . . . . . . . . . . . . . . 334 8.1.1 JDBC overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
  • 14. viii Rational Application Developer V6 Programming Guide 8.1.2 Data source versus direct connection . . . . . . . . . . . . . . . . . . . . . . . 335 8.1.3 XMI and DDL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 8.1.4 Rational Application Developer database features . . . . . . . . . . . . . 336 8.2 Preparing for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337 8.2.1 Import the BankDB sample project . . . . . . . . . . . . . . . . . . . . . . . . . 337 8.2.2 Set up the BANK sample database. . . . . . . . . . . . . . . . . . . . . . . . . 338 8.3 Data perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339 8.3.1 Data Definition view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340 8.3.2 Database Explorer view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341 8.3.3 DB Output view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342 8.3.4 Navigator view. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343 8.4 Create databases and tables from scripts. . . . . . . . . . . . . . . . . . . . . . . . 343 8.4.1 Create a database. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344 8.4.2 Create a database connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347 8.4.3 Create the database tables from scripts . . . . . . . . . . . . . . . . . . . . . 349 8.4.4 Populate database tables with data . . . . . . . . . . . . . . . . . . . . . . . . 352 8.5 Create and work with database objects . . . . . . . . . . . . . . . . . . . . . . . . . 354 8.5.1 Create a database. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355 8.5.2 Create a database connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356 8.5.3 Create a schema. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357 8.5.4 Create a table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358 8.5.5 Generate a DDL file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361 8.5.6 Deploy DDL from the workspace to a database . . . . . . . . . . . . . . . 362 8.5.7 Copy database objects from a DDL file to a workspace . . . . . . . . . 362 8.5.8 Generate DDL and XSD files for database objects. . . . . . . . . . . . . 365 8.6 UML visualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370 8.6.1 Class diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370 8.6.2 Information engineering (IE) diagrams . . . . . . . . . . . . . . . . . . . . . . 374 8.6.3 IDEF1X (Integrated Definition Extended) diagrams . . . . . . . . . . . . 375 8.7 Create SQL statements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376 8.7.1 Using the SQL Statement wizard . . . . . . . . . . . . . . . . . . . . . . . . . . 376 8.7.2 Using the SQL Query Builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384 8.8 Access a database from a Java application . . . . . . . . . . . . . . . . . . . . . . 389 8.8.1 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389 8.8.2 Access the database using the DriverManager . . . . . . . . . . . . . . . 390 8.8.3 Access using a data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393 8.9 Java stored procedures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394 8.9.1 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395 8.9.2 Create a Java stored procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . 398 8.9.3 Build a stored procedure (deploy to database) . . . . . . . . . . . . . . . . 405 8.9.4 Java DriverManager access to a Java stored procedure . . . . . . . . 408 8.9.5 JavaBean access to Java stored procedure . . . . . . . . . . . . . . . . . . 409
  • 15. Contents ix Chapter 9. Develop GUI applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415 9.1 Introduction to the Visual Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416 9.2 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416 9.2.1 Create the project for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . 417 9.2.2 Add JDBC driver for Cloudscape to project . . . . . . . . . . . . . . . . . . 417 9.2.3 Set up the sample database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418 9.2.4 Import the model classes for the sample . . . . . . . . . . . . . . . . . . . . 419 9.3 Launching the Visual Editor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419 9.3.1 Create a visual class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420 9.3.2 Open an existing class with the Visual Editor . . . . . . . . . . . . . . . . . 422 9.4 Visual Editor overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423 9.4.1 Visual Editor layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423 9.4.2 Customizing the appearance of the Visual Editor . . . . . . . . . . . . . . 424 9.5 Work with the Visual Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427 9.5.1 Resize a JavaBean component . . . . . . . . . . . . . . . . . . . . . . . . . . . 427 9.5.2 Code synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427 9.5.3 Changing the properties of a component . . . . . . . . . . . . . . . . . . . . 428 9.5.4 Add JavaBeans to a visual class. . . . . . . . . . . . . . . . . . . . . . . . . . . 428 9.5.5 Work with the Properties view. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432 9.5.6 Testing the appearance of the GUI . . . . . . . . . . . . . . . . . . . . . . . . . 433 9.5.7 Add event handling to GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434 9.5.8 Verify the Java GUI application. . . . . . . . . . . . . . . . . . . . . . . . . . . . 435 9.5.9 Run the sample GUI as a Java application . . . . . . . . . . . . . . . . . . . 436 9.5.10 Automatically add event handling . . . . . . . . . . . . . . . . . . . . . . . . . 437 9.5.11 Visual Editor binding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438 Chapter 10. Develop XML applications . . . . . . . . . . . . . . . . . . . . . . . . . . . 443 10.1 XML overview and technologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444 10.1.1 XML and XML processor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444 10.1.2 DTD and XML schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445 10.1.3 XSL and XSLT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446 10.1.4 XML namespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446 10.1.5 XPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447 10.2 Rational Application Developer XML tools . . . . . . . . . . . . . . . . . . . . . . 447 10.2.1 Create a project for XML sample . . . . . . . . . . . . . . . . . . . . . . . . . 448 10.2.2 Work with DTD files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449 10.2.3 Work with XML schema files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458 10.2.4 Work with XML files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475 10.2.5 Work with XSL files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482 10.2.6 Transform an XML file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491 10.2.7 Java code generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496 10.3 Where to find more information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
  • 16. x Rational Application Developer V6 Programming Guide Chapter 11. Develop Web applications using JSPs and servlets. . . . . . 499 11.1 Introduction to Web applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500 11.1.1 Concepts and technologies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500 11.1.2 Model-view-controller (MVC) pattern . . . . . . . . . . . . . . . . . . . . . . 503 11.2 Web development tooling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505 11.2.1 Web perspective and views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506 11.2.2 Web Projects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507 11.2.3 Web Site Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508 11.2.4 Page Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509 11.2.5 Page templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510 11.2.6 CSS Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511 11.2.7 Javascript Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511 11.2.8 WebArt Designer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511 11.2.9 AnimatedGif Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511 11.2.10 File creation wizards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512 11.3 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513 11.3.1 ITSO Bank Web application overview. . . . . . . . . . . . . . . . . . . . . . 514 11.3.2 Create a Web Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517 11.3.3 Web Project directory structure. . . . . . . . . . . . . . . . . . . . . . . . . . . 522 11.3.4 Import the ITSO Bank model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524 11.4 Define the site navigation and appearance. . . . . . . . . . . . . . . . . . . . . . 524 11.4.1 Launch the Web Site Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . 525 11.4.2 Create a new page template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526 11.4.3 Customize a page template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531 11.4.4 Customize a style sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535 11.4.5 Create the Web site navigation and pages . . . . . . . . . . . . . . . . . . 538 11.4.6 Verify the site navigation and page templates . . . . . . . . . . . . . . . 542 11.5 Develop the static Web resources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544 11.5.1 Create the index.html page content (text, links) . . . . . . . . . . . . . . 544 11.5.2 Create the rates.html page content (tables) . . . . . . . . . . . . . . . . . 546 11.5.3 Create the insurance.html page content (list) . . . . . . . . . . . . . . . . 547 11.5.4 Create the redbank.html page content (forms) . . . . . . . . . . . . . . . 548 11.6 Develop the dynamic Web resources . . . . . . . . . . . . . . . . . . . . . . . . . . 549 11.6.1 Creating model classes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550 11.6.2 Working with servlets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576 11.6.3 Working with JSPs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595 11.7 Test the application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610 11.7.1 Prerequisites to run sample Web application . . . . . . . . . . . . . . . . 611 11.7.2 Run the sample Web application . . . . . . . . . . . . . . . . . . . . . . . . . 611 11.7.3 Verify the sample Web application . . . . . . . . . . . . . . . . . . . . . . . . 611 Chapter 12. Develop Web applications using Struts . . . . . . . . . . . . . . . . 615 12.1 Introduction to Struts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
  • 17. Contents xi 12.1.1 Model-view-controller (MVC) pattern with Struts. . . . . . . . . . . . . . 616 12.1.2 Rational Application Developer support for Struts . . . . . . . . . . . . 619 12.2 Prepare for the sample application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620 12.2.1 ITSO Bank Struts Web application overview . . . . . . . . . . . . . . . . 620 12.2.2 Create a Dynamic Web Project with Struts support . . . . . . . . . . . 622 12.2.3 Add JDBC driver for Cloudscape to project . . . . . . . . . . . . . . . . . 628 12.2.4 Set up the sample database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629 12.2.5 Configure the data source. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630 12.3 Develop a Web application using Struts . . . . . . . . . . . . . . . . . . . . . . . . 632 12.3.1 Create the Struts components . . . . . . . . . . . . . . . . . . . . . . . . . . . 632 12.3.2 Realize the Struts components . . . . . . . . . . . . . . . . . . . . . . . . . . . 640 12.3.3 Modify ApplicationResources.properties. . . . . . . . . . . . . . . . . . . . 652 12.3.4 Struts validation framework. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653 12.3.5 Page Designer and the Struts tag library . . . . . . . . . . . . . . . . . . . 655 12.3.6 Using the Struts configuration file editor . . . . . . . . . . . . . . . . . . . . 659 12.4 Import and run the Struts sample application . . . . . . . . . . . . . . . . . . . . 665 12.4.1 Import the Struts Bank Web application sample . . . . . . . . . . . . . . 665 12.4.2 Prepare the application and sample database . . . . . . . . . . . . . . . 666 12.4.3 Run the Struts Bank Web application sample. . . . . . . . . . . . . . . . 666 Chapter 13. Develop Web applications using JSF and SDO . . . . . . . . . . 673 13.1 Introduction to JSF and SDO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674 13.1.1 JavaServer Faces (JSF) overview . . . . . . . . . . . . . . . . . . . . . . . . 674 13.1.2 Service Data Objects (SDO) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678 13.2 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678 13.2.1 Create a Dynamic Web Project. . . . . . . . . . . . . . . . . . . . . . . . . . . 679 13.2.2 Set up the sample database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681 13.2.3 Configure the data source via the enhanced EAR . . . . . . . . . . . . 681 13.3 Develop a Web application using JSF and SDO. . . . . . . . . . . . . . . . . . 684 13.3.1 Create a page template. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684 13.3.2 Useful views for editing page template files . . . . . . . . . . . . . . . . . 687 13.3.3 Customize the page template . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695 13.3.4 Create JSF resources using the Web Diagram tool . . . . . . . . . . . 700 13.3.5 Edit a JSF page. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715 13.3.6 Completing the SDO example. . . . . . . . . . . . . . . . . . . . . . . . . . . . 730 13.4 Run the sample Web application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746 13.4.1 Prerequisites to run sample Web application . . . . . . . . . . . . . . . . 746 13.4.2 Run the sample Web application . . . . . . . . . . . . . . . . . . . . . . . . . 747 13.4.3 Verify the sample Web application . . . . . . . . . . . . . . . . . . . . . . . . 747 Chapter 14. Develop Web applications using EGL . . . . . . . . . . . . . . . . . 751 14.1 Introduction to EGL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 752 14.1.1 Programming paradigms. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 752
  • 18. xii Rational Application Developer V6 Programming Guide 14.1.2 IBM Enterprise Generation Language. . . . . . . . . . . . . . . . . . . . . . 753 14.1.3 IBM EGL and Rational brand software . . . . . . . . . . . . . . . . . . . . . 758 14.1.4 IBM EGL feature enhancements. . . . . . . . . . . . . . . . . . . . . . . . . . 759 14.1.5 Where to find more information on EGL . . . . . . . . . . . . . . . . . . . . 761 14.2 IBM EGL tooling in Rational Developer products . . . . . . . . . . . . . . . . . 761 14.2.1 EGL preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761 14.2.2 EGL perspective and views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 762 14.2.3 EGL projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763 14.2.4 EGL wizards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763 14.2.5 EGL migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 764 14.2.6 EGL debug support. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765 14.2.7 EGL Web application components . . . . . . . . . . . . . . . . . . . . . . . . 765 14.3 Prepare for the sample application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767 14.3.1 Install the EGL component of Rational Application Developer . . . 768 14.3.2 Enable the EGL development capability . . . . . . . . . . . . . . . . . . . . 771 14.3.3 Install DB2 Universal Database . . . . . . . . . . . . . . . . . . . . . . . . . . 773 14.3.4 Create an EGL Web Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773 14.3.5 Set up the sample database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 777 14.3.6 Configure EGL preferences for SQL database connection. . . . . . 779 14.3.7 Configure the data source. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 780 14.3.8 Configure the DB2 JDBC class path environment variables. . . . . 783 14.4 Develop the Web application using EGL. . . . . . . . . . . . . . . . . . . . . . . . 784 14.4.1 Create the EGL data parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785 14.4.2 Create and customize a page template . . . . . . . . . . . . . . . . . . . . 799 14.4.3 Create the Faces JSPs using the Web Diagram tool . . . . . . . . . . 802 14.4.4 Add EGL components to the Faces JSPs. . . . . . . . . . . . . . . . . . . 806 14.5 Import and run the sample Web application . . . . . . . . . . . . . . . . . . . . . 816 14.5.1 Import the EGL Web application sample. . . . . . . . . . . . . . . . . . . . 816 14.5.2 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816 14.5.3 Generate Java from EGL source . . . . . . . . . . . . . . . . . . . . . . . . . 817 14.5.4 Run the sample EGL Web application . . . . . . . . . . . . . . . . . . . . . 818 14.6 Considerations for exporting an EGL project . . . . . . . . . . . . . . . . . . . . 820 14.6.1 Reduce the file size of the Project Interchange file . . . . . . . . . . . . 821 14.6.2 Manually adding the runtime libraries after migration . . . . . . . . . . 822 14.6.3 Export WAR/EAR with source. . . . . . . . . . . . . . . . . . . . . . . . . . . . 823 Chapter 15. Develop Web applications using EJBs. . . . . . . . . . . . . . . . . 827 15.1 Introduction to Enterprise JavaBeans . . . . . . . . . . . . . . . . . . . . . . . . . . 828 15.1.1 What is new. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 828 15.1.2 Enterprise JavaBeans overview . . . . . . . . . . . . . . . . . . . . . . . . . . 828 15.1.3 EJB server. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 831 15.1.4 EJB container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 832 15.1.5 EJB components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 834
  • 19. Contents xiii 15.2 RedBank sample application overview . . . . . . . . . . . . . . . . . . . . . . . . . 840 15.3 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 844 15.3.1 Required software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 844 15.3.2 Create and configure the EJB projects . . . . . . . . . . . . . . . . . . . . . 844 15.3.3 Create an EJB project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 845 15.3.4 Configure the EJB projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 849 15.3.5 Import BankBasicWeb Project . . . . . . . . . . . . . . . . . . . . . . . . . . . 853 15.3.6 Set up the sample database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 854 15.3.7 Configure the data source. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 856 15.4 Develop an EJB application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 858 15.4.1 Create the entity beans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 859 15.4.2 Create the entity relationships. . . . . . . . . . . . . . . . . . . . . . . . . . . . 872 15.4.3 Customize the entity beans and add business logic . . . . . . . . . . . 880 15.4.4 Creating custom finders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 890 15.4.5 Object-relational mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 892 15.4.6 Implement the session facade . . . . . . . . . . . . . . . . . . . . . . . . . . . 901 15.5 Testing EJB with the Universal Test Client . . . . . . . . . . . . . . . . . . . . . . 915 15.6 Adapting the Web application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 919 Chapter 16. Develop J2EE application clients . . . . . . . . . . . . . . . . . . . . . 925 16.1 Introduction to J2EE application clients. . . . . . . . . . . . . . . . . . . . . . . . . 926 16.2 Overview of the sample application. . . . . . . . . . . . . . . . . . . . . . . . . . . . 928 16.3 Preparing for the sample application. . . . . . . . . . . . . . . . . . . . . . . . . . . 931 16.3.1 Import the base enterprise application sample . . . . . . . . . . . . . . . 932 16.3.2 Set up the sample database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 933 16.3.3 Configure the data source. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 934 16.3.4 Test the imported code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 936 16.4 Develop the J2EE application client . . . . . . . . . . . . . . . . . . . . . . . . . . . 936 16.4.1 Create the J2EE application client projects. . . . . . . . . . . . . . . . . . 937 16.4.2 Configure the J2EE application client projects . . . . . . . . . . . . . . . 938 16.4.3 Import the graphical user interface and control classes . . . . . . . . 939 16.4.4 Create the BankDesktopController class . . . . . . . . . . . . . . . . . . . 940 16.4.5 Complete the BankDesktopController class . . . . . . . . . . . . . . . . . 942 16.4.6 Register the BankDesktopController class as the Main class. . . . 946 16.5 Test the J2EE application client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 946 16.6 Package the application client project. . . . . . . . . . . . . . . . . . . . . . . . . . 949 Chapter 17. Develop Web Services applications . . . . . . . . . . . . . . . . . . . 951 17.1 Introduction to Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 952 17.1.1 Service-oriented architecture (SOA) . . . . . . . . . . . . . . . . . . . . . . . 952 17.1.2 Web Services as an SOA implementation . . . . . . . . . . . . . . . . . . 953 17.1.3 Related Web Services standards . . . . . . . . . . . . . . . . . . . . . . . . . 955 17.2 Web Services tools in Application Developer . . . . . . . . . . . . . . . . . . . . 957
  • 20. xiv Rational Application Developer V6 Programming Guide 17.2.1 Creating a Web Service from existing resources . . . . . . . . . . . . . 957 17.2.2 Creating a skeleton Web Service . . . . . . . . . . . . . . . . . . . . . . . . . 958 17.2.3 Client development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 958 17.2.4 Testing tools for Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . 959 17.3 Preparing for the samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 959 17.3.1 Import the sample code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 959 17.3.2 Enable the Web Services Development capability . . . . . . . . . . . . 960 17.3.3 Set up the sample back-end database . . . . . . . . . . . . . . . . . . . . . 961 17.3.4 Add Cloudscape JDBC driver (JAR) to the project . . . . . . . . . . . . 962 17.3.5 Define a server to test the application. . . . . . . . . . . . . . . . . . . . . . 963 17.3.6 Test the application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 963 17.4 Create a Web Service from a JavaBean . . . . . . . . . . . . . . . . . . . . . . . . 964 17.4.1 Create a Web Service using the Web Service wizard. . . . . . . . . . 964 17.4.2 Resources generated by the Web Services wizard . . . . . . . . . . . 968 17.4.3 Test the Web Service using the Web Services Explorer. . . . . . . . 971 17.4.4 Generate and test the client proxy . . . . . . . . . . . . . . . . . . . . . . . . 973 17.4.5 Monitor the Web Service using the TCP/IP Monitor . . . . . . . . . . . 976 17.5 Create a Web Service from an EJB . . . . . . . . . . . . . . . . . . . . . . . . . . . 980 17.6 Web Services security. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 980 17.7 Publish a Web Service using UDDI. . . . . . . . . . . . . . . . . . . . . . . . . . . . 982 Chapter 18. Develop portal applications. . . . . . . . . . . . . . . . . . . . . . . . . . 985 18.1 Introduction to portals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 986 18.1.1 Portal concepts and definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . 986 18.1.2 IBM WebSphere Portal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 989 18.1.3 IBM Rational Application Developer . . . . . . . . . . . . . . . . . . . . . . . 989 18.2 Developing applications for WebSphere Portal. . . . . . . . . . . . . . . . . . . 992 18.2.1 Portal samples and tutorials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 992 18.2.2 Development strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 993 18.2.3 Portal tools for developing portals. . . . . . . . . . . . . . . . . . . . . . . . . 996 18.2.4 Portal tools for developing portlets . . . . . . . . . . . . . . . . . . . . . . . 1002 18.2.5 Portal tools for testing and debugging portlets . . . . . . . . . . . . . . 1016 18.2.6 Portal tools for deploying and managing portlets . . . . . . . . . . . . 1020 18.2.7 Enterprise Application Integration Portal Tools . . . . . . . . . . . . . . 1022 18.2.8 Coexistence and migration of tools and applications . . . . . . . . . 1023 18.3 Portal development scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1025 18.3.1 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1025 18.3.2 Create a portal project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1026 18.3.3 Add and modify a portal page . . . . . . . . . . . . . . . . . . . . . . . . . . . 1027 18.3.4 Create and modify two portlets . . . . . . . . . . . . . . . . . . . . . . . . . . 1030 18.3.5 Add portlets to a portal page . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1033 18.3.6 Run the project in the test environment . . . . . . . . . . . . . . . . . . . 1037
  • 21. Contents xv Part 3. Test and debug applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1041 Chapter 19. Servers and server configuration . . . . . . . . . . . . . . . . . . . . 1043 19.1 Introduction to server configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . 1044 19.1.1 Supported test server environments . . . . . . . . . . . . . . . . . . . . . . 1045 19.1.2 Local vs. remote test environments . . . . . . . . . . . . . . . . . . . . . . 1046 19.1.3 Commands to manage test servers . . . . . . . . . . . . . . . . . . . . . . 1046 19.2 Configure a WebSphere V6 Test Environment . . . . . . . . . . . . . . . . . . 1046 19.2.1 Understanding WebSphere Application Server V6.0 profiles . . . 1047 19.2.2 WebSphere Application Server V6 installation . . . . . . . . . . . . . . 1050 19.2.3 WebSphere Application Server V6 profile creation . . . . . . . . . . . 1051 19.2.4 Define a new server in Rational Application Developer . . . . . . . 1057 19.2.5 Verify the server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1061 19.2.6 Customize a server in Rational Application Developer . . . . . . . . 1062 19.3 Add a project to a server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1064 19.3.1 Considerations for adding a project to a server . . . . . . . . . . . . . 1064 19.3.2 Add a project to a server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1065 19.4 Remove a project from a server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1066 19.4.1 Remove a project via Rational Application Developer . . . . . . . . 1066 19.4.2 Remove a project via WebSphere Administrative Console. . . . . 1067 19.5 Publish application changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1068 19.6 Configure application and server resources . . . . . . . . . . . . . . . . . . . . 1069 19.6.1 Configure application resources . . . . . . . . . . . . . . . . . . . . . . . . . 1069 19.6.2 Configure server resources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1078 19.6.3 Configure messaging resources . . . . . . . . . . . . . . . . . . . . . . . . . 1079 19.6.4 Configure security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1079 19.7 TCP/IP Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1079 Chapter 20. JUnit and component testing . . . . . . . . . . . . . . . . . . . . . . . 1081 20.1 Introduction to application testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1082 20.1.1 Test concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1082 20.1.2 Benefits of unit and component testing . . . . . . . . . . . . . . . . . . . . 1085 20.1.3 Eclipse Hyades . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1086 20.2 JUnit testing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1087 20.2.1 JUnit fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1087 20.2.2 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1089 20.2.3 Create the JUnit test case. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1089 20.2.4 Run the JUnit test case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1098 20.3 Automated component testing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1102 20.3.1 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1102 20.3.2 Create a test project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1103 20.3.3 Create a Java component test . . . . . . . . . . . . . . . . . . . . . . . . . . 1103 20.3.4 Complete the component test code . . . . . . . . . . . . . . . . . . . . . . 1107
  • 22. xvi Rational Application Developer V6 Programming Guide 20.3.5 Run the component test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1110 20.4 Web application testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1112 20.4.1 Preparing for the sample. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1113 20.4.2 Create a Java project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1113 20.4.3 Create (record) a test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1113 20.4.4 Edit the test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1115 20.4.5 Generate an executable test . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1115 20.4.6 Create a deployment definition . . . . . . . . . . . . . . . . . . . . . . . . . . 1116 20.4.7 Run the test. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1117 20.4.8 Analyze the test results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1118 Chapter 21. Debug local and remote applications . . . . . . . . . . . . . . . . . 1121 21.1 Introduction to the debug tooling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1122 21.1.1 Summary of new Version 6 features . . . . . . . . . . . . . . . . . . . . . . 1122 21.1.2 Supported languages and environments . . . . . . . . . . . . . . . . . . 1124 21.1.3 General functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1124 21.1.4 Drop-to-frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1126 21.1.5 View Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1127 21.1.6 XSLT debugger. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1128 21.2 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1131 21.3 Debug a Web application on a local server. . . . . . . . . . . . . . . . . . . . . 1132 21.3.1 Set breakpoints in a servlet. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1132 21.3.2 Set breakpoints in a JSP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1135 21.3.3 Start the application for debugging . . . . . . . . . . . . . . . . . . . . . . . 1136 21.3.4 Run the application in the debugger . . . . . . . . . . . . . . . . . . . . . . 1136 21.3.5 Debug view with stack frames. . . . . . . . . . . . . . . . . . . . . . . . . . . 1141 21.3.6 Debug functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1141 21.3.7 Breakpoints view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1142 21.3.8 Watch variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1142 21.3.9 Inspect variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1143 21.3.10 Evaluate an expression. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1143 21.3.11 Debug a JSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1145 21.4 Debug a Web application on a remote server . . . . . . . . . . . . . . . . . . . 1145 21.4.1 Export the BankBasicWeb project to a WAR file. . . . . . . . . . . . . 1145 21.4.2 Deploy the BankBasicWeb.war. . . . . . . . . . . . . . . . . . . . . . . . . . 1146 21.4.3 Install the IBM Rational Agent Controller . . . . . . . . . . . . . . . . . . 1147 21.4.4 Configure debug on remote WebSphere Application Server . . . 1147 21.4.5 Attach to the remote server in Rational Application Developer. . 1148 21.4.6 Debug the application on the remote server . . . . . . . . . . . . . . . . 1151 Part 4. Deploy and profile applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1153 Chapter 22. Build applications with Ant . . . . . . . . . . . . . . . . . . . . . . . . . 1155 22.1 Introduction to Ant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1156
  • 23. Contents xvii 22.1.1 Ant build files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1156 22.1.2 Ant tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1157 22.2 New features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1157 22.2.1 Code Assist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1158 22.2.2 Code snippets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1159 22.2.3 Format an Ant script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1163 22.2.4 Define format of an Ant script . . . . . . . . . . . . . . . . . . . . . . . . . . . 1164 22.2.5 Problem view. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1166 22.3 Build a simple Java application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1167 22.3.1 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1168 22.3.2 Create a build file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1169 22.3.3 Project definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1171 22.3.4 Global properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1171 22.3.5 Build targets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1171 22.3.6 Run Ant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1173 22.3.7 Ant Log Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1176 22.3.8 Rerun Ant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1177 22.3.9 Forced build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1177 22.3.10 Classpath problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1178 22.3.11 Run the sample application to verify the Ant build . . . . . . . . . . 1178 22.4 Build a J2EE application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1178 22.4.1 J2EE application deployment packaging . . . . . . . . . . . . . . . . . . 1179 22.4.2 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1179 22.4.3 Create the build script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1180 22.4.4 Run the Ant J2EE application build. . . . . . . . . . . . . . . . . . . . . . . 1183 22.5 Run Ant outside of Application Developer. . . . . . . . . . . . . . . . . . . . . . 1185 22.5.1 Prepare for the headless build . . . . . . . . . . . . . . . . . . . . . . . . . . 1186 22.5.2 Run the headless Ant build script . . . . . . . . . . . . . . . . . . . . . . . . 1187 Chapter 23. Deploy enterprise applications . . . . . . . . . . . . . . . . . . . . . . 1189 23.1 Introduction to application deployment . . . . . . . . . . . . . . . . . . . . . . . . 1190 23.1.1 Common deployment considerations . . . . . . . . . . . . . . . . . . . . . 1190 23.1.2 J2EE application components and deployment modules . . . . . . 1191 23.1.3 Java and WebSphere class loader . . . . . . . . . . . . . . . . . . . . . . . 1191 23.1.4 Deployment descriptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1196 23.1.5 WebSphere deployment architecture . . . . . . . . . . . . . . . . . . . . . 1199 23.2 Prepare for the sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1212 23.2.1 Review the deployment scenarios . . . . . . . . . . . . . . . . . . . . . . . 1213 23.2.2 Install prerequisite software . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1213 23.2.3 Import the sample application Project Interchange file . . . . . . . . 1214 23.2.4 Set up the sample database . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1215 23.3 Package the application for deployment . . . . . . . . . . . . . . . . . . . . . . . 1218 23.3.1 Packaging recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . 1218
  • 24. xviii Rational Application Developer V6 Programming Guide 23.3.2 Generate the EJB to RDB mapping . . . . . . . . . . . . . . . . . . . . . . 1218 23.3.3 Customize the deployment descriptors . . . . . . . . . . . . . . . . . . . . 1220 23.3.4 Remove the Enhanced EAR datasource . . . . . . . . . . . . . . . . . . 1221 23.3.5 Generate the deploy code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1222 23.3.6 Export the EAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1222 23.4 Deploy the enterprise application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1224 23.4.1 Configure the data source in WebSphere Application Server. . . 1225 23.4.2 Deploy the EAR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1229 23.5 Verify the application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1230 Chapter 24. Profile applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1237 24.1 Introduction to profiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1238 24.1.1 Profiling features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1238 24.1.2 Profiling architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1242 24.1.3 Profiling and Logging perspective . . . . . . . . . . . . . . . . . . . . . . . . 1244 24.1.4 Profiling sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1245 24.2 Prepare for the profiling sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1246 24.2.1 Prerequisites hardware and software . . . . . . . . . . . . . . . . . . . . . 1247 24.2.2 Enable the Profiling and Logging capability . . . . . . . . . . . . . . . . 1247 24.2.3 Import the sample project interchange file . . . . . . . . . . . . . . . . . 1248 24.2.4 Publish and run sample application . . . . . . . . . . . . . . . . . . . . . . 1249 24.3 Profile the sample application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1249 24.3.1 Start server in profile mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1249 24.3.2 Collect profile information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1253 24.3.3 Analysis of code coverage information . . . . . . . . . . . . . . . . . . . . 1253 Part 5. Team development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1255 Chapter 25. Rational ClearCase integration . . . . . . . . . . . . . . . . . . . . . . 1257 25.1 Introduction to IBM Rational ClearCase . . . . . . . . . . . . . . . . . . . . . . . 1258 25.1.1 IBM Rational Application Developer ClearCase overview . . . . . 1258 25.1.2 IBM Rational ClearCase terminology . . . . . . . . . . . . . . . . . . . . . 1259 25.1.3 IBM Rational ClearCase LT installation . . . . . . . . . . . . . . . . . . . 1260 25.1.4 IBM Rational Application Developer integration for ClearCase. . 1260 25.2 Integration scenario overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1263 25.3 ClearCase setup for a new project . . . . . . . . . . . . . . . . . . . . . . . . . . . 1264 25.3.1 Enable Team capability in preferences . . . . . . . . . . . . . . . . . . . . 1264 25.3.2 Create new ClearCase project . . . . . . . . . . . . . . . . . . . . . . . . . . 1265 25.3.3 Join a ClearCase project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1268 25.3.4 Create a Web project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1274 25.3.5 Add a project to ClearCase source control . . . . . . . . . . . . . . . . . 1274 25.4 Development scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1277 25.4.1 Developer 1 adds a servlet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1277 25.4.2 Developer 1 delivers work to the integration stream . . . . . . . . . . 1279
  • 25. Contents xix 25.4.3 Developer 1 makes a baseline . . . . . . . . . . . . . . . . . . . . . . . . . . 1282 25.4.4 Developer 2 joins the project. . . . . . . . . . . . . . . . . . . . . . . . . . . . 1284 25.4.5 Developer 2 imports projects into Application Developer . . . . . . 1287 25.4.6 Developer 2 modifies the servlet. . . . . . . . . . . . . . . . . . . . . . . . . 1289 25.4.7 Developer 2 delivers work to the integration stream . . . . . . . . . . 1292 25.4.8 Developer 1 modifies the servlet. . . . . . . . . . . . . . . . . . . . . . . . . 1293 25.4.9 Developer 1 delivers new work to the integration stream . . . . . . 1294 Chapter 26. CVS integration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1299 26.1 Introduction to CVS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1300 26.1.1 CVS features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1300 26.1.2 New V6 features for team development . . . . . . . . . . . . . . . . . . . 1301 26.2 CVSNT Server implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1301 26.2.1 CVS Server installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1302 26.2.2 CVS Server repository configuration. . . . . . . . . . . . . . . . . . . . . . 1303 26.2.3 Create the Windows users and groups used by CVS . . . . . . . . . 1306 26.2.4 Verify the CVSNT installation . . . . . . . . . . . . . . . . . . . . . . . . . . . 1307 26.2.5 Create CVS users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1307 26.3 CVS client configuration for Application Developer. . . . . . . . . . . . . . . 1309 26.3.1 Configure CVS Team Capabilities . . . . . . . . . . . . . . . . . . . . . . . 1309 26.3.2 Access the CVS Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1310 26.4 Configure CVS in Rational Application Developer . . . . . . . . . . . . . . . 1312 26.4.1 Configure Rational Application Developer CVS preferences . . . 1312 26.5 Development scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1321 26.5.1 Create and share the project (step 1 - cvsuser1) . . . . . . . . . . . . 1322 26.5.2 Add a shared project to the workspace (step 2 - cvsuser2) . . . . 1327 26.5.3 Modifying the Servlet (step 2 - cvsuser1) . . . . . . . . . . . . . . . . . . 1332 26.5.4 Synchronize with repository (step 3 - cvsuser1) . . . . . . . . . . . . . 1333 26.5.5 Parallel development (step 4 - cvsuser1 and cvsuser2) . . . . . . . 1335 26.5.6 Versioning (step 5- cvsuser1) . . . . . . . . . . . . . . . . . . . . . . . . . . . 1342 26.6 CVS resource history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1343 26.7 Comparisons in CVS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1344 26.7.1 Comparing workspace file with repository. . . . . . . . . . . . . . . . . . 1345 26.7.2 Comparing two revisions in repository . . . . . . . . . . . . . . . . . . . . 1347 26.8 Annotations in CVS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1348 26.9 Branches in CVS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1350 26.9.1 Branching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1350 26.9.2 Merging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1354 26.9.3 Refreshing server-defined branches . . . . . . . . . . . . . . . . . . . . . . 1357 26.10 Work with patches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1360 26.11 Disconnecting a project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1360 26.12 Synchronize perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1361 26.12.1 Custom configuration of resource synchronization . . . . . . . . . . 1362
  • 26. xx Rational Application Developer V6 Programming Guide 26.12.2 Schedule synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1367 Part 6. Appendixes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1369 Appendix A. IBM product installation and configuration tips. . . . . . . . 1371 IBM Rational Application Developer V6 installation . . . . . . . . . . . . . . . . . . . 1372 Rational Application Developer installation . . . . . . . . . . . . . . . . . . . . . . . 1372 WebSphere Portal V5.0 Test Environment installation . . . . . . . . . . . . . . 1376 WebSphere Portal V5.1 Test Environment installation . . . . . . . . . . . . . . 1377 Rational Application Developer Product Updater - Interim Fix 0004. . . . 1380 IBM Rational Agent Controller V6 installation . . . . . . . . . . . . . . . . . . . . . . . 1382 IBM Rational ClearCase LT installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1385 IBM DB2 Universal Database V8.2 installation . . . . . . . . . . . . . . . . . . . . . . 1387 IBM WebSphere Application Server V6 installation . . . . . . . . . . . . . . . . . . . 1387 WebSphere Application Server messaging configuration . . . . . . . . . . . . . . 1389 Configure the service bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1390 Configure the bus members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1390 Configure the destinations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1390 Verify the messaging engine startup. . . . . . . . . . . . . . . . . . . . . . . . . . . . 1391 Configure JMS connection queue factory . . . . . . . . . . . . . . . . . . . . . . . . 1391 Configure the destination JMS queue . . . . . . . . . . . . . . . . . . . . . . . . . . . 1392 Configuration of a JMS activation specification. . . . . . . . . . . . . . . . . . . . 1392 Appendix B. Additional material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1395 Locating the Web material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1396 System requirements for downloading the Web material . . . . . . . . . . . . 1396 Unpack the 6449code.zip. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1396 Description of sample code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1396 Import sample code from a Project Interchange file. . . . . . . . . . . . . . . . . . . 1398 Related publications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1401 IBM Redbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1401 Other publications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1402 Online resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1402 How to get IBM Redbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1404 Help from IBM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1404 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1405
  • 27. © Copyright IBM Corp. 2005. All rights reserved. xxi Notices This information was developed for products and services offered in the U.S.A. IBM may not offer the products, services, or features discussed in this document in other countries. Consult your local IBM representative for information on the products and services currently available in your area. Any reference to an IBM product, program, or service is not intended to state or imply that only that IBM product, program, or service may be used. Any functionally equivalent product, program, or service that does not infringe any IBM intellectual property right may be used instead. However, it is the user's responsibility to evaluate and verify the operation of any non-IBM product, program, or service. IBM may have patents or pending patent applications covering subject matter described in this document. The furnishing of this document does not give you any license to these patents. You can send license inquiries, in writing, to: IBM Director of Licensing, IBM Corporation, North Castle Drive Armonk, NY 10504-1785 U.S.A. The following paragraph does not apply to the United Kingdom or any other country where such provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you. This information could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time without notice. Any references in this information to non-IBM Web sites are provided for convenience only and do not in any manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of the materials for this IBM product and use of those Web sites is at your own risk. IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring any obligation to you. Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products. This information contains examples of data and reports used in daily business operations. To illustrate them as completely as possible, the examples include the names of individuals, companies, brands, and products. All of these names are fictitious and any similarity to the names and addresses used by an actual business enterprise is entirely coincidental. COPYRIGHT LICENSE: This information contains sample application programs in source language, which illustrates programming techniques on various operating platforms. You may copy, modify, and distribute these sample programs in any form without payment to IBM, for the purposes of developing, using, marketing or distributing application programs conforming to the application programming interface for the operating platform for which the sample programs are written. These examples have not been thoroughly tested under all conditions. IBM, therefore, cannot guarantee or imply reliability, serviceability, or function of these programs. You may copy, modify, and distribute these sample programs in any form without payment to IBM for the purposes of developing, using, marketing, or distributing application programs conforming to IBM's application programming interfaces.
  • 28. xxii Rational Application Developer V6 Programming Guide Trademarks The following terms are trademarks of the International Business Machines Corporation in the United States, other countries, or both: AIX® Balance® ClearCase MultiSite® ClearCase® Cloudscape™ DB2 Universal Database™ DB2® developerWorks® Informix® IBM® ibm.com® IMS™ iSeries™ Lotus Notes® Lotus® Notes® OS/390® OS/400® Rational Rose® Rational Unified Process® Rational® Redbooks™ Redbooks (logo) ™ RUP® S/390® ThinkCentre™ VisualAge® VisualGen® WebSphere® Workplace™ Workplace Web Content Management™ XDE™ z/OS® zSeries® The following terms are trademarks of other companies: 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. Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both. Intel, Intel Inside (logos), MMX, and Pentium are trademarks of Intel Corporation in the United States, other countries, or both. UNIX is a registered trademark of The Open Group in the United States and other countries. Linux is a trademark of Linus Torvalds in the United States, other countries, or both. Other company, product, and service names may be trademarks or service marks of others.
  • 29. © Copyright IBM Corp. 2005. All rights reserved. xxiii Preface IBM® Rational® Application Developer V6.0 is the full function Eclipse 3.0 based development platform for developing Java™ 2 Platform Standard Edition (J2SE) and Java 2 Platform Enterprise Edition (J2EE) applications with a focus on applications to be deployed to IBM WebSphere® Application Server and IBM WebSphere Portal. Rational Application Developer provides integrated development tools for all development roles, including Web developers, Java developers, business analysts, architects, and enterprise programmers. This IBM Redbook is a programming guide that highlights the features and tooling included with IBM Rational Application Developer V6.0. Many of the chapters provide working examples that demonstrate how to use the tooling to develop applications as well as achieve the benefits of visual and rapid Web development. This book consists of six parts: 򐂰 Introduction to Rational Application Developer 򐂰 Develop applications 򐂰 Test and debug applications 򐂰 Deploy and profile applications 򐂰 Team development 򐂰 Appendixes The team that wrote this redbook This redbook was produced by a team of specialists from around the world working at the International Technical Support Organization, Raleigh Center.
  • 30. xxiv Rational Application Developer V6 Programming Guide Figure 1 IBM Redbook team (top, l-r: Neil Weightman, Fabio Ferraz, Richard Raszka, Juha Nevalainen; bottom, l-r: Hari Kanangi, John Ganci, Nicolai Nielsen, Kiriya Keat) John Ganci is a Consulting IT Specialist at the IBM ITSO, Raleigh Center, USA. John has 15 years of experience in application design, development, testing, and consulting. His areas of expertise include e-business integration, WebSphere Application Server, e-commerce, portals, pervasive computing, technical team leadership, Linux®, and J2EE programming. Daniel Farrell is a Certified Specialist in the IBM Software Group USA. He has a Masters degree in Computer Science from Regis University and is currently pursuing a PhD from Clemson in Adult Education and Human Resource Studies. He has 20 years of experience working with Informix® and related database technologies, and more recently has been focusing on IBM EGL and supporting tooling.
  • 31. Preface xxv Fabio Ferraz is the Chief Consultant for Advus Corp, São Paulo, Brazil. He has 12 years of experience in the IT field, with eight of those dedicated to e-business. Ed Gondek is a Product Manager in the USA with IBM Software Group - Rational products division. He has 25 years of Information Systems and software management experience with expertise in 4GLs, Web-based application design, Web analytics, business intelligence tooling, and software product delivery. Hari Kanangi is a Senior Technical Consultant for Stratus Solutions, Inc. He has nine years of industry experience. Over the past six years, Hari has focused on WebSphere, J2EE, and Java-based technologies. His expertise includes architecting, designing, developing, and deploying J2EE-based solutions. He is a Sun-certified Java Programmer, architect, and a WebSphere-certified specialist. Kiriya Keat is an IT Specialist in Australia with IBM Global Services. He has five years of experience in the Web development field. His areas of expertise include e-business integration, application architecture and development, technical team leadership, and WebSphere solutions. George Kroner is a Co-op IT Specialist at the IBM ITSO Center in Raleigh, North Carolina. He is currently pursuing a Bachelor of Science degree in Information Sciences and Technology at Pennsylvania State University. His interests include Web applications, wireless/mobile computing, and intelligent interfaces. Juha Nevalainen is an Consulting IT Specialist for Rational Technical Sales with IBM Finland. His areas of expertise include Rational brand software products, WebSphere Commerce, e-business, and systems integration. Nicolai Nielsen is an Advisory IT Specialist with IBM Global Services, Denmark. He has nine years of experience in the fields of consulting, application development, and systems integration. Nicolai holds a degree in engineering from the Technical University of Denmark. He has written extensively about WebSphere Commerce, J2EE application development, and has worked on several WebSphere Commerce projects over the last three years. Richard Raszka is a Senior IT Specialist in IBM Global Services, Application Management Services, Australia. He has 19 years of IT experience in the fields of application development, systems integration (particularly of e-business/e-commerce solutions), project planning, compiler development, configuration management, graphics and CAD/CAM development, simulation, and agent-oriented artificial intelligence. He holds degrees in Mechanical Engineering, Mathematical and Computer Science from the University of Adelaide and a Masters of Technology Management from Monash University in Melbourne. His areas of expertise include end-to-end systems integration, application design including patterns, application architecture, and development,
  • 32. xxvi Rational Application Developer V6 Programming Guide technical team leadership, e-business solutions, WebSphere Application Server, UNIX®, J2EE architecture, and Java development. Neil Weightman is a Technical Instructor in the United Kingdom. He has 15 years of experience in the software development field. He holds a degree in Physics from Imperial College, University of London, and a masters in Scientific Computing from South Bank University, London. His areas of expertise include J2EE component development, Web services development, and best practices. Thanks to the following people for their contributions to this project: 򐂰 Ueli Wahli, Ian Brown, Fabio Ferraz, Maik Schumacher, Henrik Sjostrand who wrote the previous redbook edition, WebSphere Studio Application Developer Version 5 Programming Guide, SG24-6957 򐂰 Special thanks to Eric Erpenbach from the IBM WebSphere Technology and Training organization for providing early training materials on IBM Rational Application Developer V6.0, which was a tremendous help in ramping up on the new features for many topics found in this book 򐂰 Beverly DeWitt, Rational Application Developer Product Manager, IBM Toronto, Canada 򐂰 Geni Hutton, Rational Application Developer Product Manager, IBM Toronto, Canada 򐂰 Todd Britton, Manager for IBM Rational Application Developer Tools Development, IBM Raleigh, USA 򐂰 Kate Price, Rational Application Developer Information Development, IBM Toronto, Canada 򐂰 Leigh Davidson, Rational Application Developer Information Development Editor, IBM Toronto, Canada 򐂰 Tim Deboer, IBM WebSphere Tools, IBM Toronto, Canada 򐂰 Prem Lall, IT Specialist for IBM Global Services, IBM Gaithersburg, USA 򐂰 Chris Feldhacker, Principal Financial Group Become a published author Join us for a two- to six-week residency program! Help write an IBM Redbook dealing with specific products or solutions, while getting hands-on experience with leading-edge technologies. You'll team with IBM technical professionals, Business Partners and/or customers.
  • 33. Preface xxvii Your efforts will help increase product acceptance and customer satisfaction. As a bonus, you'll develop a network of contacts in IBM development labs, and increase your productivity and marketability. Find out more about the residency program, browse the residency index, and apply online at: ibm.com/redbooks/residencies.html Comments welcome Your comments are important to us! We want our Redbooks™ to be as helpful as possible. Send us your comments about this or other Redbooks in one of the following ways: 򐂰 Use the online Contact us review redbook form found at: ibm.com/redbooks 򐂰 Send your comments in an email to: redbook@us.ibm.com 򐂰 Mail your comments to: IBM Corporation, International Technical Support Organization Dept. HZ8 Building 662 P.O. Box 12195 Research Triangle Park, NC 27709-2195 Summary of changes This section describes the technical changes made in this edition of the book and in previous editions. This edition may also include minor corrections and editorial changes that are not identified. Summary of Changes for SG24-6449-00 for the Rational Application Developer V6 Programming Guide June 2005, First Edition This book is a major rewrite ofWebSphere Studio Application Developer Version 5 Programming Guide, SG24-6957. The previous book was based on Application Developer Version 5; this book is based on Version 6.
  • 34. xxviii Rational Application Developer V6 Programming Guide This revision reflects the addition, deletion, or modification of new and changed information described below. New information 򐂰 Broaden appeal – Improves user assistance and ease of learning – Progressive disclosure of tools 򐂰 Raise productivity – Rapid Web and Portal application development – Rapid deployment to WebSphere Application Server V6.0 򐂰 Extended integration – Integration of Rational technology to enhance the application development lifecycle and raise productivity – Enhance portal as a first-class deployment target 򐂰 Maintain standards and middleware support – Java 2 Platform Enterprise Edition V1.4 specification compliance – Support for many new integrated test servers including WebSphere Application Server V6.0/V5.x, and WebSphere Portal V5.0.2.2 – New and enhanced tooling (Web Services, EGL, Visual UML, portal, Struts, JSF, SDO, etc.). Changed information 򐂰 General update of existing information to Version 6 Deleted information 򐂰 Developing Web applications with database access using DB beans. The preferred method of database access is Service Data Objects (SDO).
  • 35. © Copyright IBM Corp. 2005. All rights reserved. 1 Part 1 Introduction to Rational Application Developer Part 1
  • 36. 2 Rational Application Developer V6 Programming Guide
  • 37. © Copyright IBM Corp. 2005. All rights reserved. 3 Chapter 1. Introduction IBM Rational Application Developer V6.0 is the full function development platform for developing Java 2 Platform Standard Edition (J2SE) and Java 2 Platform Enterprise Edition (J2EE) applications with a focus on applications to be deployed to IBM WebSphere Application Server and IBM WebSphere Portal. This chapter contains an introduction to the concepts, packaging, and features of IBM Rational Application Developer V6.0 and IBM Rational Web Developer V6.0 products. The chapter is organized into the following sections: 򐂰 Introduction and concepts 򐂰 Product packaging 򐂰 Product features 򐂰 Sample code 1 Note: Although this chapter does contain information on both IBM Rational Application Developer V6.0 and IBM Rational Web Developer V6.0, the majority of the chapters and samples found in this book were only tested with IBM Rational Application Developer V6.0.
  • 38. 4 Rational Application Developer V6 Programming Guide 1.1 Introduction and concepts This section provides an introduction to the Rational Software Development Platform, Eclipse, Rational Application Developer, and Rational Web Developer. Rational products help your business or organization manage the entire software development process. Software modelers, architects, developers, and testers can use the same team-unifying Rational Software Development Platform tooling to be more efficient in exchanging assets, following common processes, managing change and requirements, maintaining status, and improving quality. 1.1.1 IBM Rational Software Development Platform The IBM Rational Software Development Platform is not a single product, but rather an integrated set of products that share a common technology platform built on the Eclipse 3.0 framework in support of each phase of the development life cycle. The IBM Rational Software Development Platform provides a team-based environment with capabilities that are optimized for the key roles of a development team including business analyst, architect, developer, tester, and deployment manager. It enables a high degree of team cohesion through shared access to common requirements, test results, software assets, and workflow and process guidance. Combined, these capabilities improve both individual and team productivity. Figure 1-1 on page 5 provides perspective on how the Rational Application Developer and Rational Web Developer products fit within the IBM Rational Software Development Platform product set.
  • 39. Chapter 1. Introduction 5 Figure 1-1 Rational Software Development Platform products We have included a brief description of each of the products included in the IBM Rational Software Development Platform (see Figure 1-1) that share common tooling based on the IBM Eclipse SDK V3.0 (IBM-supported Eclipse 3.0): 򐂰 Rational Software Modeler The Software Modeler is a UML-based visual modeling and design tool for system analysts, software architects, and designers who need to clearly define and communicate their architectural specifications to stakeholders. This product was known in previous releases as Rational XDE™ Modeler and is targeted at development shops where the business analyst has a distinct role of architecture and design (no development). 򐂰 Rational Software Architect The Software Architect is a design and construction tool that leverages model-driven development with UML for creating well-architected applications, including those based on a Service Oriented Architecture (SOA). It unifies modeling, Java structural review, Web Services, J2SE, J2EE, database, XML, Web development, and process guidance for architects and senior developers creating applications in Java or C++. This product was known in previous releases as Rational Rose® and Rational XDE for Java. Software Architect includes architecture and design capability as well as full J2EE development functionality provided by Rational Application Developer. This product is targeted at development shops where Rational SoftwareDevelopment Platform(IBMEclipse SDK3.0) WebSphere Business Integrator Modeler Rational Web Developer Rational Application Developer Rational Software Architect Rational Software Modeler Rational Function Tester Rational Performance Tester Analyst Architect / Application Developer Tester Rational Manual Tester
  • 40. 6 Rational Application Developer V6 Programming Guide the architect has a strong architecture and design role, as well as application development. If architects only need the modeling functionality, they should use the Rational Software Modeler product. 򐂰 Rational Web Developer The IBM Rational Web Developer (or simply Web Developer) extends the capabilities of Eclipse 3.0 with visual tools for Web, Java, and rich client applications, and full support for XML, Web services, and Enterprise Generation Language. In previous releases this product was known as WebSphere Studio Site Developer. Rational Web Developer is packaged with IBM WebSphere Application Server Express V6.0. 򐂰 Rational Application Developer The IBM Rational Application Developer is a full suite of development, analysis, and deployment tools for rapidly implementing J2EE applications, Enterprise JavaBeans, portlets, and Web applications. In previous releases this product was known as WebSphere Studio Application Developer and is targeted at J2EE developers. 򐂰 Rational Functional Tester The Rational Function Tester is an automated testing tool that tests Java, HTML, VB.NET, and Windows® applications. It provides the capability to record robust scripts that can be played back to validate new builds of an application. 򐂰 Rational Performance Tester The Rational Performance Tester is a multi-user system performance test product designed to test Web applications, and focuses on ease-of-use and scalability. 򐂰 WebSphere Business Integrator Modeler The WebSphere Business Integrator Modeler does not carry the Rational brand name, but is an important product of the Rational Software Development Platform. WebSphere Business Integrator Modeler targets the business analyst who models business processes. WebSphere Business Integrator Modeler can be used to generate Business Process Execution Language (BPEL) definitions to be deployed to WebSphere Business Integrator production environments. The WebSphere Business Integrator Modeler BPEL provides a more seamless move to production and eliminates the need to create Visio diagrams and then move to production. Note: IBM Rational Application Developer V6.0 is the focus of this book.
  • 41. Chapter 1. Introduction 7 1.1.2 Version 6 terminology Table 1-1 provides a basic terminology comparison from Version 6 and Version 5 for reference purposes. Table 1-1 Terminology 1.1.3 Application development challenges To better grasp the business value that IBM Rational Application Developer V6.0 provides, it is important to understand the challenges businesses face in application development. Table 1-2 highlights the key application development challenges as well as desired development tooling solutions. Table 1-2 Application development challenges Version 6 Version 5 Rational Developer Note: Used to describe development products built on common Eclipse base WebSphere Studio Rational Application Developer (known as Application Developer) WebSphere Studio Application Developer Rational Web Developer (known as Web Developer) WebSphere Studio Site Developer IBM Eclipse SDK 3.0 Note: IBM branded and value-added version of Eclipse SDK 3.0 WebSphere Studio Workbench (IBM supported Eclipse 2.x) Workbench Workbench IBM Rational Software Development Platform Note: Used to describe product set built on common Eclipse 3.0 platform N/A Challenges Solution tooling Application development is complex, time consuming, and error prone. Raise productivity by automating time consuming and error prone tasks. Highly skilled developers are required and in short supply. Improve code quality early in the development life cycle.
  • 42. 8 Rational Application Developer V6 Programming Guide 1.1.4 Key themes of Version 6 There are many very significant enhancements and features in IBM Rational Application Developer V6.0. We have listed the key themes of Version 6 tooling: 򐂰 Broaden appeal. – Improves user assistance and ease of learning – Progressive disclosure of tools 򐂰 Raise productivity. – Rapid Web and Portal application development – Rapid deployment to WebSphere Application Server and WebSphere Portal 򐂰 Extended integration. – Integration of Rational technology to enhance the application development life cycle and raise productivity – Enhances portal as a first-class deployment target 򐂰 Maintain standards and middleware support. – Java 2 Platform Enterprise Edition V1.4 specification compliance – Support for many new integrated test servers including WebSphere Application Server V6.0/V5.x and WebSphere Portal V5.0.2.2/5.1 – New and enhanced tooling (Web Services, EGL, Visual UML, portal, etc.) 򐂰 Team unifying platform. As described in “IBM Rational Software Development Platform” on page 4, Rational Application Developer and Rational Web Developer are products included in the IBM Rational Software Development Platform product set that promote team development. We provide more detail on the these new features in “Summary of new features in Version 6” on page 14, as well as throughout the chapters of this book. Learning curves are long. Shorten learning curves by providing Rapid Application Development (RAD) tooling (visual layout and design, resusable components, code generators, etc.). Challenges Solution tooling
  • 43. Chapter 1. Introduction 9 1.2 Product packaging This section highlights the product packaging for IBM Rational Web Developer V6.0 and IBM Rational Application Developer V6.0. 1.2.1 Rational Developer supported platforms and databases This section describes the platforms and databases supported by the Rational Developer products. Supported operating system platforms IBM Rational Application Developer V6.0 supports the following operating systems: 򐂰 Microsoft® Windows: – Windows XP with Service Packs 1 and 2 – Windows 2000 Professional with Service Packs 3 and 4 – Windows 2000 Server with Service Packs 3 and 4 – Windows 2000 Advanced Server with Service Packs 3 and 4 – Windows Server 2003 Standard Edition – Windows Server 2003 Enterprise Edition 򐂰 Linux on Intel®: – Red Hat Enterprise Linux Workstation V3 (all service packs) – SuSE Linux Enterprise Server (SLES) V9 (all service packs) The IBM Rational Agent Controller included with IBM Rational Application Developer V6.0 is supported on many platforms running WebSphere Application Server. For details refer to the Installation Guide, IBM Rational Application Developer V6.0 product guide (install.html) found on the IBM Rational Application Developer V6 Setup CD 1. Supported databases IBM Rational Application Developer V6.0 supports the following database products: 򐂰 IBM Cloudscape™ V5.0 򐂰 IBM Cloudscape V5.1 (bundled with the WebSphere Application Server V6.0 Test Environment) 򐂰 IBM DB2 Universal Database V8.1 򐂰 IBM DB2 Universal Database V8.2 򐂰 IBM DB2 Universal Database Express V8.1 򐂰 IBM DB2 Universal Database Express V8.2 򐂰 IBM DB2 Universal Database for iSeries™ V4R5 򐂰 IBM DB2 Universal Database for iSeries V5R1
  • 44. 10 Rational Application Developer V6 Programming Guide 򐂰 IBM DB2 Universal Database for iSeries V5R2 򐂰 IBM DB2 Universal Database for iSeries V5R3 򐂰 IBM DB2 Universal Database for z/OS® and OS/390® V7 򐂰 IBM DB2 Universal Database for z/OS V8 򐂰 Informix Dynamic Server V7.3 򐂰 Informix Dynamic Server V9.2 򐂰 Informix Dynamic Server V9.3 򐂰 Informix Dynamic Server V9.4 򐂰 Microsoft SQL Server V7.0 򐂰 Microsoft SQL Server 2000 򐂰 Oracle8i V8.1.7 򐂰 Oracle9i 򐂰 Oracle10g 򐂰 Sybase Adaptive Server Enterprise V12 򐂰 Sybase Adaptive Server Enterprise V12.5 1.2.2 Rational Application Developer V6 product packaging Table 1-3 lists the software CDs included with IBM Rational Application Developer V6.0. Table 1-3 IBM Rational Application Developer V6.0 product packaging CDs Windows Linux IBM Rational Application Developer V6.0 - Core installation files (required) X X IBM WebSphere Application Server V6.0 Integrated Test Environment X X IBM WebSphere Application Server V5.0.2/V5.1 Integrated Test Environment X X IBM Enterprise Generation Language (EGL) X X IBM Rational Application Developer V6.0 - Language Pack X X IBM WebSphere Portal V5.0.2.2 Integrated Test Environment Note: IBM WebSphere Portal V5.1 Test Environment is installed via its own installer on a separate CD packaged with Rational Application Developer. X N/A
  • 45. Chapter 1. Introduction 11 1.2.3 Rational Web Developer V6 product packaging Table 1-4 lists the software CDs included with IBM Rational Web Developer V6.0. Table 1-4 IBM Rational Web Developer V6.0 product packaging IBM WebSphere Portal V5.1 Test Environment The following CDs are included for the WebSphere Portal V5.1 Test Environment (separate installer from Rational Application Developer): 򐂰 IBM WebSphere Portal V5.1 - Portal Install (Setup) CD 򐂰 IBM WebSphere Portal V5.1 - WebSphere Business Integrator Server Foundation (1-1) CD 򐂰 IBM WebSphere Portal V5.1 - WebSphere Business Integrator Server Foundation (1-2) CD 򐂰 IBM WebSphere Portal V5.1 - WebSphere Business Integrator Server Foundation WebSphere Application Server V5.1 Fixpack 1 (1-15) CD 򐂰 IBM WebSphere Portal V5.1 - Portal Server (2) CD 򐂰 IBM WebSphere Portal V5.1 - Lotus® Workplace™ Web Content Management (3) CD X X IBM Rational Agent Controller Note: Support for many additional platforms X X IBM WebSphere Application Server V5 - Embedded messaging client and server X X IBM Rational ClearCase® LT Note: Web download Web Web Crystal Enterprise V10 Professional Edition X X Crystal Enterprise V10 Embedded Edition X na IBM DB2 Universal Database V8.2, Express Edition X X IBM WebSphere Application Server for Developers V6.0 (IBM HTTP Server, Web server plug-ins, DataDirect JDBC drivers, Appl. Clients) X X CDs Windows Linux CD title Windows Linux IBM Rational Web Developer V6.0 - Core installation files (required) X X IBM WebSphere Application Server V6.0 Integrated Test Environment X X IBM WebSphere Application Server V5.0.2 and V5.1 Integrated Test Environment X X IBM Enterprise Generation Language (EGL) X X IBM Rational Web Developer V6.0 - Language Pack X X
  • 46. 12 Rational Application Developer V6 Programming Guide 1.3 Product features This section provides a summary of the new features of IBM Rational Application Developer V6.0 and IBM Rational Web Developer V6.0. We will provide more detailed information on the new features throughout the chapters of this book. Figure 1-2 on page 13 displays a summary of features found in the IBM Rational Developer V6.0 products. We have organized the description of the product features into the following topics: 򐂰 Summary of new features in Version 6 򐂰 Specification versions 򐂰 Eclipse and IBM Rational Software Development Platform 򐂰 Test server environments 򐂰 Licensing and installation 򐂰 Migration and coexistence 򐂰 Tools IBM Rational Agent Controller Note: Support for many additional platforms X X IBM DB2 Universal Database V8.2, Express Edition X X IBM WebSphere Application Server for Developers V6.0 (IBM HTTP Server, Web server plug-ins, DataDirect JDBC drivers, Appl. Clients) X X CD title Windows Linux
  • 47. Chapter 1. Introduction 13 Figure 1-2 Tools and features summary Figure 1-3 provides a summary of technologies supported by Rational Application Developer categorized by the applications component. Figure 1-3 Supported technologies for developing applications IB ME c lip s eS D K3 .0 •IB Mc o m m e rc ia llys u p p o rte dE c lip s e3 .0 •IB MR a tio n a lS o ftw a reD e v e lo p m e n tP la tfo rmto o lin g A p p lic a tio nS e rv e rT o o l (A S T ) IB MR a tio n a l W e bD e v e lo p e r IB MR a tio n a l A p p lic a tio nD e v e lo p e r •T o o lfo ra s s e m b ly ,d e p lo y m e n t(E J B ,W e bS e rv ic e s ) a n dd e b u gJ 2 E Ea p p lic a tio n s •N od e v e lo p m e n ts u p p o rt •W e b S p h e reR a p idD e p lo y m e n t •S u p p o rtfo rE n a h a n c e dE A R •S e rv e rT o o ls–s u p p o rtfo rre m o tes e rv e r •F u ll d e v e lo p m e n ts u p p o rt •S u p p o rtfo rJ 2 E E1 .2 ,1 .3 ,1 .4W e bb a s e d a p p lic a tio n s(J S F ,S tru ts ,S D Oto o ls ) •N oE J B ,J 2 Cd e v e lo p m e n ts u p p o rt •S e rv e rT e s tE n v iro n m e n ts(W e b S p h e re A p p lic a tio nS e rv e rV 5 .0 ,5 .1 ,6 .0 ,T o m c a t 5 .0a n dW e b L o g ic6 .1 ,7 .1 ,8 .1a v a ila b le s e p a ra te ly ) •V is u a l J a v aG U Ib u ild e r •W e bD ia g ra mE d ito r •S iteD e s ig n e r •P a g eT e m p la te s •X M Lto o ls •W e bS e rv ic e sto o ls •D a ta b a s eto o ls •P o rta l a n dp o rtle td e v e lo p m e n t •E n te rp ris eG e n e ra tio nL a n g u a g e(E G L ) to o ls •D e b u g g e r •F u ll J 2 E E1 .4s u p p o rt •P o rta l T e s tE n v iro n m e n t5 .0 .2 .2 •U M LV is u a l e d ito rs •S ta tica n dru n tim ea n a ly s is •E x te n d e dd e b u g g in ga n d p ro filin g •C o m p o n e n tte s ta u to m a tio n •C le a rC a s eL Tfo rte a m in te g ra tio n •R a tio n a l U n ifie dP ro c e s s(R U P ) in te g ra tio n User Interface Services HTML JSP WML VML JSF Portlets Servlets Struts JSF JavaBeans EJB 4GL Control Logic Business Logic Enterprise Information Connection JDBC JCA JMS Web Services Business Process Integration WSDL SOAP UDDI XML BPEL SOA
  • 48. 14 Rational Application Developer V6 Programming Guide 1.3.1 Summary of new features in Version 6 There are many new features in VERSION 6, many of which we highlight in detail in the remaining chapters of this book. The objective of this section is to summarize the new features in IBM Rational Application Developer V6.0: 򐂰 Specification versions: Full support for J2EE V1.4 and IBM WebSphere Application Server V6.0. See “Specification versions” on page 18 for more information on new features. 򐂰 Eclipse and IBM Rational Software Development Platform: Based on Eclipse 3.0. See “Eclipse and IBM Rational Software Development Platform” on page 19 for more information on new features. 򐂰 Test server environments: – Test environments included for WebSphere Application Server V6.0, V5.1, V5.0, and WebSphere Portal V5.0.2.2, V5.1. – Integration with IBM WebSphere Application Server V6.0 for deployment, testing, and administration is the same (test environment, separate install, and Network Deployment edition). See “Test server environments” on page 22 for more information on new features. 򐂰 Web Services: – Build and consume Web Services with JSR 101/109 support for implementing Web Services for EJBs and Java beans. – Support for setting conformance levels, including WS-I SSBP 1.0 (simple SOAP Basic Profile 1.0) and WS-I AP (Attachments Profile 1.0). – Integrated SOAP Monitor to view Web Services traffic via creation wizard. – Secure Web Services request/response capability using WS-Security (security values specified in the J2EE deployment descriptor). For more detailed information and a programming example, refer to Chapter 17, “Develop Web Services applications” on page 951. 򐂰 Portal application development: – Rational Application Developer V6.0 includes portal development tooling, as well as integrated test environments for WebSphere Portal V5.0.2 and V5.1. – Model-View-Control (MVC) architecture for portal applications, including support for JSF or Struts. – Portal Site Designer for WebSphere Portal V5.0.2.2 and V5.1 to customize the layout and navigation or portal pages. – Wired portlets used to link portlets.
  • 49. Chapter 1. Introduction 15 – Portlets for business process tasks via integration with WebSphere Business Integrator (WBI). – SAP and Seibel integration using JSF and SDO. For more detailed information and a programming example, refer to Chapter 18, “Develop portal applications” on page 985. 򐂰 Application modeling with UML: – Model EJBs (top down or bottom up), Java classes, and database schemas visually. – New topic, browse, and sequence diagram views available for viewing class relationships and method interaction. – This feature is offered in Rational Application Developer and Rational Software Architect (not Rational Web Developer). For more detailed information and a programming example, refer to Chapter 6, “RUP and UML” on page 189. 򐂰 Rational Unified Process® integration: – Process Browser provides search capability for Rational Unified Process (RUP®) best practices and life cycle for development. – Process Advisor view displays RUP information specific to current task. – This feature is offered in Rational Application Developer and Rational Software Architect (not Rational Web Developer). For more detailed information and a programming example, refer to Chapter 6, “RUP and UML” on page 189. 򐂰 Annotated programming: – EJB and Web resources can be created with annotations following the proposed XDoclet standard (JSR 175). – A number of required development resources are reduced since code is generated at the time of deployment. 򐂰 Application code analysis: Application code can be reviewed for coding practices. The application code analysis tool can identify the problem and provide examples and a possible solution following best practice guidelines. 򐂰 Rapid Web Development: – Page template provides a common and consistent look, feel, and layout for Web applications. Page template fragments are now available with support for nesting page templates. – Web Site Designer provides group support for applying page templates and creating navigation bars.
  • 50. 16 Rational Application Developer V6 Programming Guide – Drag and drop page design and construction. – Struts includes enhancements for the Web Diagram Editor for visual Struts development and improved integration with portal. – Point and click database access. – Event-driven programming model. – Automated code construction. – Rich client construction. – Robust Web services construction and consumption. – XML integration and database access. 򐂰 JavaServer Faces (JSF): – Full support for JSF 1.0 (JSR 127), plus additional IBM components – Enhanced visual development of JSF with Web Diagram Editor, such as visual layout of different actions and navigation of JSF pages – Client components off new display formats for data For more detailed information and a programming example, refer to Chapter 13, “Develop Web applications using JSF and SDO” on page 673. 򐂰 Service Data Objects (SDO): – Service Data Objects (SDO) offers a common API for working with data across heterogeneous datastores. – Access to different datastores becomes transparent as access is through mediators. – Developers can focus on real problems rather than spend time learning low-level data access APIs. – Available for use in Web and EJB components. For more detailed information and a programming example, refer to Chapter 13, “Develop Web applications using JSF and SDO” on page 673. 򐂰 Crystal Reports integration: – New Report Designer included for designing Crystal Reports. – JSF components for Crystal Enterprise included for adding Crystal Reports to Web applications from Palette view. – Development and testing licenses included for Crystal Enterprise V10 Professional and Embedded Editions. – This feature is offered in Rational Application Developer and Rational Software Architect (not Rational Web Developer). For more detailed information refer to the product documentation.
  • 51. Chapter 1. Introduction 17 򐂰 Enterprise Generation Language (EGL): – High-level programming language for developing business logic previously available in WebSphere Studio Application Developer V5 Enterprise Edition – Easy language for non-Java developers for building applications – Independent of implementation to hide the complexities of the technology (encourages Rapid Application Development) – EGL code generated to Java for runtime For more detailed information and a programming example, refer to Chapter 14, “Develop Web applications using EGL” on page 751 򐂰 Component testing: – Easy creation, execution, and maintenance of dynamic unit tests for J2EE components (Java classes, EJBs 1.1/2.0/2.1, Web services). – Test patterns available for defining complex unit test cases. – Test data can be stored in separate data pool table for flexible test case definition. – Based on JUnit framework and open source Hyades project. – This feature is offered in Rational Application Developer and Rational Software Architect (not Rational Web Developer). For more detailed information and examples, refer to Chapter 20, “JUnit and component testing” on page 1081. 򐂰 Profiling tools: – Enhanced Memory Analysis features help locate memory leaks in heap dumps – New Thread Analysis view for monitoring thread state for locks – New ProbeKit feature allows for easy profiling at key points in the application using byte-code instrumentation – Robust summary and detailed code and line execution statistics with Code Coverage feature For more detailed information and profiling examples, refer to Chapter 24, “Profile applications” on page 1237. 򐂰 Additional enhancements: – Database tools: Many enhancements around SQL Tools, SQLJ, and importing, exporting, and deploying stored procedures and user-defined functions. – XML: Enhancements to WSDL, XML Schema, and XPATH editors.
  • 52. 18 Rational Application Developer V6 Programming Guide – XSLT: New debugging capabilities allow developers to debug XSLT called from Java and Java called from XSLT. – WebSphere Programming Model Extensions (PMEs): Snippet and Deployment Descriptors included to enable applications. Note that PMEs are not included within the scope of this book. 1.3.2 Specification versions This section highlights the specification versions found in IBM Rational Application Developer V6.0, which supports development for the Java 2 Platform Enterprise Edition V1.4. We have included WebSphere Studio Application Developer V5.0 for comparison purposes, which is based on the Java 2 Platform Enterprise Edition V1.3. Table 1-5 includes a comparison of the J2EE specification versions, and Table 1-6 on page 19 includes a comparison of the WebSphere Application Server specification versions. Table 1-5 J2EE specification versions Specification Rational Application Developer V6.0 WebSphere Studio Application Developer V5.0 IBM Java Runtime Environment (JRE) 1.4.2 1.3.1 JavaServer Page (JSP) 2.0 1.2 Java Servlet 2.4 2.3 Enterprise JavaBeans (EJB) 2.1 2.0 Java Message Service (JMS) 1.1 1.0 Java Transaction API (JTA) 1.0 1.0 JavaMail 1.3 1.2 Java Activation Framework (JAF) 1.0 1.0 Java API for XML Processing (JAXP) 1.2 1.0 J2EE Connector 1.5 1.0 Web Services 1.1 1.0 Java API for XML RPC (JAX-RPC) 1.1 N/A SOAP with Attachments API for Java (SAAJ) 1.2 N/A
  • 53. Chapter 1. Introduction 19 Table 1-6 WebSphere Application Server specification versions 1.3.3 Eclipse and IBM Rational Software Development Platform This section provides an overview of the Eclipse Project as well as how Eclipse relates to the IBM Rational Software Development Platform and IBM Rational Application Developer V6.0. Eclipse Project The Eclipse Project is an open source software development project devoted to creating a development platform and integrated tooling. Java Authentication and Authorization Service (JAAS) 1.2 1.0 Java API for XML Registries (JAXR) 1.0 N/A J2EE Management API 1.0 N/A Java Management Extensions (JMX) 1.2 N/A J2EE Deployment API 1.1 N/A Java Authorization Service Provider Contract for Containers (JAAC) 1.0 N/A Specification Rational Application Developer V6.0 WebSphere Studio Application Developer V5.0 JavaServer Faces (JSF) 1.0 (JSR 127) N/A Note: JSF 1.0 included in WSAD V5.1.2 Service Data Objects (SDO) 1.0 N/A Note: SDO 1.0 formerly named WDO included in WSAD V5.1.2 Struts 1.1 1.0.2 and 1.1 Beta 2 Note: Struts 1.0.2 and 1.1 included in WSAD V5.1.1 and V5.1.2 Specification Rational Application Developer V6.0 WebSphere Studio Application Developer V5.0
  • 54. 20 Rational Application Developer V6 Programming Guide Figure 1-4 on page 20 depicts the high-level Eclipse Project architecture and shows the relationship of the following sub projects: 򐂰 Eclipse Platform 򐂰 Eclipse Java Development Tools (JDT) 򐂰 Eclipse Plug-in Development Environment (PDE) Figure 1-4 Eclipse Project overview With a common public license that provides royalty free source code and world-wide redistribution rights, the Eclipse Platform provides tool developers with great flexibility and control over their software technology. Industry leaders like IBM, Borland, Merant, QNX Software Systems, RedHat, SuSE, TogetherSoft, and WebGain formed the initial eclipse.org board of directors of the Eclipse open source project. More detailed information on Eclipse can be found at: http://www.eclipse.org Eclipse Platform The Eclipse Platform provides a framework and services that serve as a foundation for tools developers to integrate and extend the functionality of the Platform. The Platform includes a Workbench, concept of projects, user interface libraries (JFace, SWT), built-in help engine, and support for team development and debug. The Platform can be leveraged by a variety of software development Platform Runtime Workspace Help Team Workbench JFace SWT Eclipse Project Java Development Tools (JDT) Their Tool Your Tool Another Tool Plug-in Development Environment (PDE) Eclipse Platform Debug
  • 55. Other documents randomly have different content
  • 56. Am 20. Oktober Mittags zwölf Uhr begann die Verhandlung. Die Richter waren aus dem Sitz des Generalkommandos herübergekommen und saßen mit ernsten Gesichtern an dem langen Tisch, ein Major, ein Hauptmann, ein Oberleutnant, ein Kriegsgerichtsrat als Führer der Verhandlung und ein zweiter, welcher die Anklage erhob. Nachdem Schmitz nochmals den Sachverhalt geschildert, wurde Roth als Zeuge vernommen. Er stellte die Angelegenheit im grellsten Lichte dar, wollte nichts von einer Freundschaft wissen und leugnete auch auf das Entschiedenste, ebenfalls betrunken gewesen zu sein, wie es Schmitz behauptete. Als Zeugen seiner Nüchternheit hatte er den Lungenkranken und den Polen gewonnen, welch' letzterem er eingepaukt hatte, auf alle Fragen mit dem Kopfe zu schütteln, womit er auch Glück hatte, da die Fragen zufällig entsprechend gestellt waren. Schließlich beschwor der Vicewachtmeister mit fester Stimme die Wahrheit seiner Aussage. Das war allerdings eine unerwartete Wendung. Schmitz hatte nicht erwartet, auch noch mit der Lüge kämpfen zu müssen, und seine Hoffnungen sanken beträchtlich, als er den Major mißbilligend mit dem Kopfe schütteln sah. Es folgte sodann die Anklagerede des Kriegsgerichtsrats, die etwa wie die Anklageschrift lautete. Sodann erhob sich der Verteidiger. Mit beredten Worten schilderte er nochmals den Vorgang, erwog die näheren Umstände, wies auf das ihm durch Zeugen bestätigte frühere Verhältnis der Gegner und schließlich darauf hin, daß sich der ganze Vorgang im Anschluß an eine Geburtstagsfeier zugetragen habe. Nach alledem, und mit Rücksicht auf die bisherige Führung des Angeklagten sei auf Freisprechung zu erkennen. Das Gericht zog sich zur Beratung zurück und es dauerte lange, bis die Herren mit ernsten Gesichtern wieder im Verhandlungszimmer erschienen.
  • 57. Schmitz glaubte einen Augenblick die Besinnung verlieren zu müssen, als er das Urteil vernahm: zwei Monate Gefängnis! Er sah sein Leben vernichtet. Umsonst waren die langen Jahre, die er mit Aufopferung seiner besten Kraft dem Vaterlande gedient; seine Zukunftspläne, nach zwölfjähriger Dienstzeit eine Anstellung am Bürgermeisteramt seiner Vaterstadt zu erhalten, waren mit einem Schlage vernichtet. Was würden seine Eltern, seine Geschwister sagen, was sollte aus seiner Braut werden? Eine namenlose Wut packte ihn, den Mann hätte er auf der Stelle würgen können, der mit Gemeinheit, Lüge und Meineid sein Dasein zerstört und jetzt mit höhnischer Miene an ihm vorüberschritt. Ja, er hörte den Kommandeur zu dem ehrlosen Lumpen sagen: »So ist's recht, Roth, scharf im Dienst, so wünsche ich mir meine Unteroffiziere.« Nun, die Rache sollte nicht ausbleiben. Schmitz wurde am 21. Oktober durch einen Wachtmeister auf Festung gebracht, wo viele Stunden der Selbstverleugnung und schwere Tage seiner warteten. So kam allmählich die Weihnachtszeit heran. Schnee bedeckte den Kasernenhof, alles lag öde, leblos und starr durch die grimmige Kälte der letzten Tage. Ein großer Teil der Mannschaften hatte Urlaub für die Festtage erhalten, und ein jeder nahm im Dienst seine ganze Kraft zusammen, um nicht im letzten Augenblick der zu erwartenden Freuden beraubt zu werden. Fast allabendlich fuhren die Herren des Offizierkorps, natürlich ohne Urlaub, nach der Nachbarstadt, um Weihnachtseinkäufe zu machen, denn nach Hause fahren wollte nur einer von ihnen, die anderen beabsichtigten eine kleine Feier im Kasino, wo sie sich gegenseitig kleine Geschenke zu machen gedachten. Borgert und Leimann kehrten stets mit Packeten beladen zurück, sie kauften alles, was ihnen gefiel, Geld würde sich später einmal finden, denn jetzt pumpte ja jeder mit Freuden, wenn er nur seine Ware los wurde.
  • 58. An den geschäftlichen Teil in der Stadt schloß sich meist ein kleines Gelage in einem guten Restaurant, und oft kam es vor, daß die Herren in recht angeregter Stimmung den letzten Zug zur Garnison bestiegen. Eines Abends hatte auch der neue Riesling besonders gut geschmeckt, und alle langten ziemlich »blau« in später Nacht zu Hause an. Der Regimentsadjutant fand ein Diensttelegramm in seiner Wohnung vor und mußte sich noch einmal, trotz der späten Stunde zum Regimentsschreiber begeben, um mit diesem über die Erledigung des Telegramms Rücksprache zu nehmen. Starker Schneefall war eingetreten, und der scharfe Ostwind trieb die Flocken in wildem Wirbelspiel durch die kalte Luft, sodaß man die Augen zusammenkneifen mußte und nur mit Mühe den zugewehten Weg erkennen konnte. Die Störung zu mitternächtlicher Stunde paßte dem bequemen Müller gar nicht und er schimpfte vor sich hin, als er die Allee zur Kaserne entlang schritt. Auch pflegte er in angeheitertem Zustand meist schlechte Laune zu haben, war händelsüchtig und brach gerne einen Streit vom Zaune, in dessen Verlauf er in unschöner Weise auf seine Sonderstellung als Adjutant und seine dabei gewonnene Diensterfahrung hinwies. Die Kameraden nannten es Größenwahn. Durch die schneeerfüllte Luft sah man nur vor dem hellen Fenster der Wachtstube die dicken Flocken in wildem Spiele tanzen, drinnen aber schlief der Wachthabende und neben ihm zwei Gemeine. Der Offizier vom Dienst war schon dagewesen und so hatte man es sich bequem gemacht, der Vorschrift entgegen Säbel und Helm abgelegt, den Rock geöffnet und eine warme Decke aus der Kaserne herbeigeholt. Auf Posten stand der Gemeine Röse. Er hatte in dem Schilderhaus Schutz vor dem Unwetter gesucht und stand, den Säbel in der kalten Faust, an der Rückwand des schwarz und weiß gestrichenen
  • 59. Häuschens. Warum sollte er das nicht? Es war ja ausdrücklich gestattet! Seine Gedanken weilten in der Ferne bei den Eltern und Geschwistern, die er in zwei Tagen zum ersten Male seit langer Trennung wieder sehen sollte. Wie freute er sich auf diese Stunde, da er nun als schmucker Kavallerist die Lieben daheim begrüßen, alte Freunde und im Stall den »Hans«, das brave Pferd, die blanken Kühe und die fetten Schweine wiedersehen durfte! Aus seinen Gedanken schreckte ihn plötzlich ein lauter Ruf: »Posten!« Röse blinzelte durch die runde Luke an der Seitenwand des Schilderhauses, konnte aber niemand entdecken. Erst auf einen nochmaligen, laut durch die Winternacht hallenden Ruf trat er heraus und erkannte in dem undurchsichtigen Schneetreiben eine Gestalt, welche auf ihn zukam. »Warum präsentieren Sie nicht, Sie Schwein!« brüllte der Regimentsadjutant. »Verzeihen Herr Leutnant, ich habe Herrn Leutnant nicht gesehen.« »Halt' die Schnauze, verlogenes Aas, geschlafen hast du im Schilderhaus, eine Ewigkeit stehe ich hier und warte. Aber ich werde dir zeigen, du Bauer, was du zu tun hast!« Damit schritt er vorbei und ließ Röse in starrem Schrecken stehen. Aus dem Regimentsgeschäftszimmer schrieb er folgende Meldung: »Den von 12 bis 2 stehenden Posten fand ich bei einer Revision schlafend im Schilderhause vor. Derselbe trat erst nach zweimaligem Anruf heraus. Etwaige Einwendungen des Mannes, mich nicht gesehen zu haben, muß ich von vornherein als Unwahrheit bezeichnen, da ich genau bemerkt habe, daß er geschlafen hat.« Die Meldung legte er auf den Arbeitstisch des Kommandeurs. Dann holte er den Schreiber aus dem Bett, verhandelte mit dem im Hemd auf dem kalten Korridor vor ihm stehenden Manne fast zehn Minuten
  • 60. und schritt dann seiner Wohnung zu. Er hatte jetzt sein Mütchen gekühlt und konnte ruhig schlafen. — — Am Nachmittag des 22. Dezember kehrte Sergeant Schmitz aus dem Gefängnis zurück. Die früher so stolze, stramme Haltung hatte er verloren, sein Gesicht war bleich und der sonst so keck in die Höhe gewirbelte schwarze Schnurrbart hing strähnig um die Mundwinkel. Scheu sah er die ihm Begegnenden an, und wenn ein Soldat ihn grüßte, hielt er es für eine besondere Freundlichkeit, die ihm nicht zukomme, da er glaubte, in aller Augen zu lesen: »Seht, das ist ein Bestrafter, ein Verbrecher!« Als er sich beim Schwadronchef zurückmeldete, reichte ihm dieser die Hand. »Tut mir leid, mein lieber Schmitz, daß ich Sie verlieren muß, Sie waren mir stets ein Untergebener, auf den ich stolz war und der seinen Dienst wie kein zweiter getan hat. Aber der Oberst hat befohlen, daß ich die Kapitulation mit Ihnen aufhebe und Sie sofort entlasse. Der Wachtmeister wird mit Ihnen das Nötige ordnen. Trösten Sie sich mit dem Gedanken, daß Sie das Opfer einer gemeinen Gesinnung geworden sind, und so wünsche ich Ihnen alles Gute; wenn Sie mich brauchen können, bin ich stets mit Freuden bereit. Leben Sie wohl!« Schmitz unterdrückte mit großer Mühe das Weinen, der Rittmeister aber ging dem Stall zu. Es ging ihm wirklich nahe, dieser nette, stramme Kerl, eine Stütze der Schwadron, um nichts und wieder nichts ins Unglück gestürzt und auf die Straße gesetzt! Es war eine Schweinerei! So ging denn Schmitz zum Wachtmeister, der ihm seine Papiere und fünfzig Mark auf sein Sparkassenbuch übergab. Auch er drückte ihm bewegt die Hand. »Haben Sie noch Invalidenansprüche, Schmitz?« fragte er darauf.
  • 61. »Ich habe Rheumatismus seit dem Manöver, wo wir wegen Seuchenverdacht der Pferde drei Wochen biwakieren mußten!« »Das haben Sie aber damals nicht gemeldet, und es ist schon fast 1½ Jahre her.« »Gemeldet habe ich es nicht, weil ich mich nicht krank schreiben lassen wollte, ich mochte den Rittmeister mit den heruntergekommenen Pferden nicht sitzen lassen.« »Ich werde beim Regiment sofort Meldung machen, Sie können ja einstweilen Ihre Sachen abgeben!« So stieg denn Schmitz zu seiner Stube hinauf, packte die Montierungsstücke zusammen und schnürte seine paar Habseligkeiten in einen kleinen Koffer. Ehe er aber seine Uniform auszog, ging er in die Stadt und kaufte für 45 Mark einen Zivilanzug, einen Kragen und einen Hut. Schuhe besaß er noch. Dann brachte er alle Uniformstücke dem Quartiermeister auf die Kammer, dem er auch seinen Extrarock, eine eigene Mütze und eine lange Hose für dreißig Mark verkaufte. Den Säbel wollte er als Erinnerung aufheben. Jetzt kam das Schwerste, der Abschied von den Kameraden und den Pferden. Jeder hatte ein freundliches Wort für ihn, und mancher stumme Händedruck gab den schmerzlichen Gefühlen Ausdruck, mit denen man den lieben Kameraden scheiden sah. Selbst die Mannschaften drängten sich heran, um von ihm Abschied zu nehmen, er hatte sie zwar manchmal tüchtig vorgenommen, aber sie kannten ihn als einen anständigen Kerl, der sie nicht im Stiche ließ, wenn es darauf ankam. Als der Mittagsstalldienst zu Ende war, ging Schmitz in den Stall. Kein Gang war ihm im Leben so schwer geworden, wie dieser, und als er die geliebten Tiere aus den eben gefüllten Krippen zu sich aufblicken sah, sobald sie seine Stimme hörten, da hätte er laut aufschreien mögen vor Weh und Schmerz.
  • 62. Für »Klärchen« hatte er ein Stück Zucker mitgebracht und sowie er zu ihm in den Stand trat, suchte es gleich nach dem gewohnten Leckerbissen und bat mit gehobenem Fuß um einen zweiten. Er legte seinen Kopf an den sammetweichen Hals des Tieres, strich ihm kosend über die schönen Augen und die weichen Nüstern und küßte das Tier auf den Hals. Als er es verließ, glaubte er in dem traurigen Blick und den leisen Wiehern einen Abschiedsgruß zu empfinden. Auch von der alten »Marie« nahm er Abschied. Wie lange mochte sie wohl noch den Dienst aushalten? Zuletzt ging er zu »Napoleon«, dem Schmerzenskinde, aber auch er zeigte heute keine Spur der gewohnten Bösartigkeit, sondern sah den fremden Mann in Zivil mit fragenden Augen an. Noch einen letzten Blick warf er auf seine Lieblinge, dann ging er mit unterdrücktem Schluchzen wieder der Stube zu, um seinen Koffer zu holen. Im Eingang trat ihm der Wachtmeister entgegen. »Mit Ihren Invalidenansprüchen ist es nichts, Schmitz, der Oberst hat gesagt, Sie hätten es gleich melden müssen, jetzt könnte jeder kommen. Dann hat er mir noch die Rechnung Ihres Rechtsanwaltes übergeben, der das Regiment um Eintreibung der Schuld ersucht hat. Es sind sechzig Mark, wenn Sie nicht zahlen können, soll eine Pfändung vorgenommen werden.« Daran hatte Schmitz gar nicht mehr gedacht. »In einer Stunde ist das Geld zur Stelle, Herr Wachtmeister!« sagte er nach kurzem Bedenken. Darauf ging er der Stadt zu und trat bei einem Uhrmacher ein, legte seine silberne Uhr mit Kette auf den Ladentisch und fragte mit fester Stimme: »Was geben Sie mir dafür? Ich brauche Geld!« Der Uhrmacher besah mit spöttischen Augen das Stück und sagte dann achselzuckend: »Zwanzig Mark, das ist aber reichlich Geld.«
  • 63. Schmitz rechnete. Fünfunddreißig hatte er noch, zwanzig dazu machte fünfundfünfzig, es fehlten noch fünf Mark. Da streifte er entschlossen einen Ring vom Finger, das einzige Andenken an seinen verstorbenen Vater. »Was ist Ihnen der wert?« »Zehn Mark, mehr nicht!« »Gut, geben Sie her, Sie haben es dafür!« Schmitz strich die drei Goldstücke ein, ging zur Kaserne, zahlte dem Wachtmeister sechzig Mark aus und holte seinen Koffer, um den Abendzug zur Stadt noch zu erreichen. Wer den bleichen Mann mit dem kleinen Koffer gesenkten Blickes dahinziehen sah, ahnte nicht, daß es ein königlich preußischer Sergeant war, der jetzt eines ungeschickten kleinen Vergehens wegen, ohne einen Pfennig, aber mit Rheumatismus in allen Knochen und einer zertretenen Vaterlandsliebe im Herzen auf die Straße gesetzt war, um sich ein neues Lebensziel zu suchen, nachdem er seine beste Kraft, seine Gesundheit und seine Jugend dem Staat geopfert hatte. Auf der Anhöhe, von welcher aus man einen Blick auf die in ihrem weihnachtlichen Schneegewande ruhende Kaserne hatte, schaute er noch einmal hinunter und schüttelte drohend den Arm, einen wütenden Fluch ausstoßend. Dann bestieg er auf dem Bahnhof einen Wagen vierter Klasse desselben Zuges, in welchem zahlreiche Soldaten singend und scherzend nach der Heimat fuhren, um dort im Kreise der Familie das Weihnachtsfest zu feiern. — Der Abend des 24. Dezember war gekommen. Alle Welt, Tausende, Millionen waren heute glücklich, fühlten den Zauber, den das schönste aller Christenfeste selbst auf das härteste Gemüt ausübt, weil es heilige Erinnerungen in uns weckt. Es ist das hohe Fest der Liebe Gottes zum Menschen, der Liebe des Christen zum Nächsten. Und keiner ist es, den nicht der feierliche Klang der Weihnachtsglocken in eine weiche Rührung, eine stille Andacht
  • 64. versetzt: der mächtige König im Palast und der Arme in seiner Hütte, selbst der Verbrecher hinter der Kerkermauer, alle öffnen ihr Herz den Strahlen der Liebe, die es an diesem Abend durchleuchten.
  • 65. Friedrich Röse saß in der schlecht erwärmten Arrestzelle, in welcher er die 14tägige Strafe wegen Wachtvergehens verbüßte. Durch den mit Eisblumen bedeckten kleinen Lichtschacht sah er hinauf nach dem Fenster im ersten Stock der 3. Eskadron, wo ein Weihnachtsbaum im Lichterglanz erstrahlte. Schwermütig ernst ertönten die Klänge jenes ewig schönen Weihnachtsliedes, dessen Musik gerade in ihrer Eintönigkeit ergreifend wirkt. Fröstelnd saß er auf dem Rand der harten Holzpritsche, und eine Träne rollte über die Wangen hinab auf das Steinpflaster des Fußbodens. Wieder weilten die Gedanken daheim, aber nicht freudig, erwartungsvoll, sondern Verstimmung, Schmerz und Sehnsucht lagen in den Zügen des jungen Mannes. Mit welcher Freude, welchem Eifer hatte er sich zum Militär gemeldet! Schon sein Vater, einst Wachtmeister der Gardekürassiere, schilderte das herrliche Soldatenleben in den schönsten Farben und hatte keinen größeren Wunsch, als seinen Jungen einmal als flotten Unteroffizier wiederzusehen. Aber das gab es jetzt nicht mehr, er war bestraft mit strengem Arrest, gebrandmarkt für seine ganze Dienstzeit. Die freudige Lust am Soldatenstande hatte sich mit einem Male in Haß und Ingrimm verwandelt gegen den bunten Rock, gegen alles, was Soldat sein bedeutete, mit einem Schlage war aus dem diensteifrigen, strebsamen Rekruten einer von den vielen geworden, die nur Soldat sind, weil sie es müssen und die den Tag der Entlassung als den ihrer Freiheit ersehnen. Und warum war das alles? Nicht weil er wissentlich seine Pflicht verletzt hatte, sondern weil es einem jener Herren Offiziere einfiel, die Laune seiner Trunkenheit an dem ersten besten Opfer auszulassen, das ihm in die Hände fiel. Und was der Herr in seiner Meldung behauptete, stand als bombenfeste Tatsache da, wer daran zweifelte, beging ein neues Vergehen, die Achtungsverletzung.
  • 66. Röse hatte auf die bezügliche Frage seines Rittmeisters den Vorgang geschildert und seine Unschuld hoch und heilig beteuert, aber der Adjutant hatte hierauf erwidert, der Mann wolle sich jetzt herauslügen. Was er gemeldet habe, sei Tatsache. Oder sollte er zugestehen: Ich habe dir Unrecht getan, habe mich geirrt, denn ich war betrunken und übler Laune? Fiel ihm gar nicht ein, er konnte sich diese Blöße nicht geben. Wie durfte er, der unnahbare, nie fehlende Regimentsadjutant eingestehen, sich geirrt zu haben? Er irrte sich eben nie, und was schadete es groß dem Kerl, wenn er die paar Tage brummte? Was es schadete? Daß es einen Apostel mehr gab, der verkündete, er sei als Soldat ein gepeinigter, in ein beschwerliches Joch gezwungener Mensch, der Spielball seiner Vorgesetzten gewesen, die ihre Laune an ihm ausließen, wie es ihnen behagte, daß unverdiente Härte und Ungerechtigkeit, gegen die es keine genügende Waffe gab, da zu finden gewesen seien, wo indviduelle Behandlung, Rücksicht und einsichtsvolle Überlegung am Platze wären. Und was es weiter schadete? Daß Jedermann, dem Röse in späteren Jahren seine Papiere vorlegte, die Achseln zuckte und dachte: »Du scheinst mir auch kein zuverlässiger Bruder zu sein, 14 Tage wegen Wachtvergehens, das ist übel!« — — — — Gegen neun Uhr schreckte Röse ein Geräusch an der Tür aus seinen Gedanken. Ein Schlüsselbund klapperte, das Schloß schnappte und herein trat der Offizier vom Dienst, hinter welchem der Wachthabende stand. Röse sprang auf, nahm eine militärische Haltung ein und meldete: »Gemeiner Röse mit 14 Tagen wegen Wachtvergehens bestraft!« Der Offizier schaute einen Augenblick in das Innere der dunkelen Zelle, ob er nicht etwa einen verbotenen Gegenstand außer der
  • 67. Schlafdecke und dem Wasserkrug entdeckte, dann wandte er sich zum Gehen. Da sagte Röse zögernd: »Gestatten der Herr Leutnant eine Bitte?« »Wenden Sie sich an den Wachthabenden, wenn Sie etwas wollen«, entgegnete der Offizier kurz und tappte die Steintreppe hinunter, vorsichtig um sich schauend, daß er sich den grauen Mantel an dem staubigen Treppenhaus nicht beschmutze. Der Wachthabende begleitete ihn bis zum Ausgang und kehrte dann zu Röse zurück. »Was wolltest du denn?« fragte er wohlwollend. »Ich wollte bitten, wenn ein Brief für mich da wär, daß ich ihn jetzt bekommen kann, Herr Unteroffizier!« antwortete Röse schüchtern. »Ja, mein Junge,« lachte der Unteroffizier gutmütig, »das geht eigentlich nicht — erst absitzen, dann's Vergnügen.« Wie er aber Röse, der von seiner Schwadron war und den er gut leiden mochte, mit dem trübseligen Gesichte vor sich stehen sah, tat ihm der arme Junge leid. Es war doch eine harte Sache, hier den heiligen Abend verleben zu müssen und obendrein wegen einer solchen Lappalie, und schließlich sogar unschuldig. Er sagte daher freundlich zu Röse: »Na ja, ich werde mal nachfragen lassen.« Er verschloß die Zelle wieder und schickte einen Mann zu Röse's Berittführer mit der Bitte, doch einmal zu ihm zu kommen. Und als dieser herbeigekommen war, fragte der Wachthabende den Berittführer: »Ist ein Brief für den Röse da?« »Ein Brief nicht, aber ein Packet habe ich für ihn vom Wachtmeister bekommen!« »Weiß du was?« flüsterte der Wachthabende, »mach die Kiste auf und bring dem Kerl was rüber, das arme Luder tut mir leid.«
  • 68. Der Berittführer nickte und verschwand, um bald mit einem Brief, einer Wurst und einem Stück Kuchen zurückzukehren. Der Wachthabende nahm alles in Empfang und stieg zu Röse hinauf. Gleichzeitig hieß er einen Mann mit einem Eimer Kohlen mit sich gehen. Nach wenigen Minuten flackerte das Feuer in der Zelle wieder hell und Röse stand davor, um beim flackernden Schein den Brief der Eltern zu lesen. Dabei rannen ihm beständig die Tränen über die Backen. Dann versteckte er wie einen kostbaren Schatz Wurst und Kuchen hinter der Pritsche, hüllte sich in seine Decke ein und legte sich auf das harte Holzbett nieder. Bald schloß der Schlaf die verweinten Augen, und im Traum saß Röse daheim unter'm Weihnachtsbaum im Kreise seiner Eltern und Geschwister. Der 28. Dezember war ein Trauertag für die vierte Schwadron. Die Leute, die erst am Abend vorher von Urlaub zurückgekehrt waren, gaben heute einem Kameraden das letzte Geleit: man trug den Gefreiten Dietrich zum Friedhof hinaus. Er war stets ein schwächlicher Mensch gewesen. Damals aber, als er erhitzt und vom Regen durchnäßt in die kalte Stube kam und kein Feuer anbrennen konnte, weil ihm Roth die Kohlen verweigerte, packte ihm am selbigen Abend ein heftiges Fieber. Nach zwei Tagen stellte der Arzt Gelenkrheumatismus fest, der so stark auftrat, daß das Herz in Mitleidenschaft gezogen wurde und der Arme am ersten Weihnachtsfeiertage an Herzschlag starb. Die tieferschütterten Eltern hatten zwar telegraphisch um Überführung der Leiche ihres einzigen Sohnes zum Heimatsort gebeten, doch da das Geld für einen Zinksarg und den Transport nicht kam, fand die Beerdigung auf dem Garnisonsfriedhof statt. Am nächsten Tage wurde auch der vom Pferde geschlagene dicke Reserve-Gefreite aus dem Lazaret entlassen. Seine Verletzungen schienen zwar geheilt, doch war das ganze Gesicht durch die zurückgebliebenen Narben schrecklich entstellt und das linke Auge
  • 69. durch eine Operation entfernt worden, da man infolge der Verletzung desselben fürchtete, das andere Auge könnte in Mitleidenschaft gezogen werden. So kehrte denn der Unglückliche als Halbinvalide mit einer monatlichen Pension von neun Mark in die Heimat zurück. Der ehemalige Sergeant Schmitz saß am Sylvesterabend in seiner dürftigen Stube. Er hatte sich, um der äußersten Not vorzubeugen, als Arbeiter einer großen Fabrik der Nachbarstadt verdingt und konnte so wenigstens seinen Lebensunterhalt verdienen. Er bewohnte ein mäßiges Zimmer im zweiten Stock eines Arbeiterhauses und wurde von der darin hausenden Familie gegen geringes Entgeld mit verpflegt. Jetzt saß er am Tisch, den Kopf in beide Hände gestützt. Vor ihm stand ein Teller mit den Resten des kärglichen Abendbrotes, und eine kleine Lampe mit zerbrochenem Schirm warf einen matten, rötlichen Schein auf die am Tisch sitzende Gestalt und die ärmliche Einrichtung des kleinen Raumes. An der Wand stand ein eisernes Bett mit rot und weiß kariertem Bezug, und darüber waren Klinge und Scheide des Säbels übers Kreuz befestigt. Auf einem kleinen Holzschemel stand eine Waschschüssel, daneben lag ein graues Handtuch. Das Feuer in dem kleinen Ofen war längst erloschen, nur einzelne klimmende Köhlchen lebten noch darin. Wer den Mann da sitzen sah, konnte glauben, einen Schlafenden vor sich zu haben, aber Schmitz wachte, und in seinem Kopf jagten wilde Gedanken durcheinander. Er dachte an vergangene Zeiten, und je schroffer ihm seine jetzige Lebenslage von früheren Zeiten abzustechen schien, um so grimmiger wurde sein Haß gegen den, welcher ihn in seine jetzige Lage gebracht; er sann auf Rache, wie er jenen elenden Schurken strafen und brandmarken könne für seine gewissenlose, gemeine Handlungsweise.
  • 70. Eine Weile noch saß er brütend da, dann erhob er sich mit finsterem Gesicht und trat an's Fenster, hauchte ein kleines Loch in die dicken Eisblumen und schaute hindurch nach der erleuchteten Uhr des Kirchturmes, aus dem jetzt das melodische Läuten der Glocken in die kalte Nacht hinaus drang, das Herannahen des neuen Jahres kündend. Elf Uhr! Schmitz setzte seinen Hut auf, ergriff den Spazierstock, blies die Lampe aus und ging die dunkle Treppe hinab. Auf der eisbedeckten Steinstufe vor der Haustür verweilte er einen Augenblick und lauschte dem dumpfen, feierlichen Glockenton. Sonst vernahm man keinen Laut, keinen menschlichen Tritt, nur ein fernes Rauschen wie ein Atem erfüllte die Luft, der Atem einer Großstadt in der Silvesternacht. Schmitz schlug fröstelnd den Rockkragen hoch, steckte beide Hände in die Hosentaschen und ging, den Stock unter'm Arm, eiligen Schrittes dem Bahnhof zu, wo er für 20 Pfennig eine Fahrkarte nach seiner früheren Garnison erstand und den bereitstehenden Zug bestieg. Das kleine Städtchen lag wie ausgestorben in seiner schneeichten Hülle. Von der Kaserne flimmerten die hell erleuchteten Fenster wie Sterne herüber, und mitunter tönten abgebrochene Weisen eines Gesanges, oder einzelne Akkorde, vom Winde sanft getragen, klangen in die Nacht hinaus. In der Ferne summte es von dem Läuten zahlreicher Kirchenglocken, welche in den vielen umliegenden Dörfern und Flecken das neue Jahr begrüßten. Aus den hell erleuchteten Kneipen und Restaurationen aber ertönte lautes Reden, Lachen und Gesang fröhlicher Zecher, die dem neuen Jahr einen frischen Trunk entgegenbrachten. Schmitz ging dem Stadtende zu, an welchem die Kaserne lag und machte vor einem Wirtshause Halt. Scheu blickte er um sich, ob Niemand ihn beobachte, dann stieg er auf den Rand der Mauer und schaute durch das angelaufene Fenster.
  • 71. Richtig, dort saß der Roth, im Kreise einiger Unteroffiziere und Gefreiten, denn hier pflegte er allabendlich bis in die tiefe Nacht zu zechen oder ein Spielchen zu machen. Vorsichtig stieg er wieder herab und schritt der Kaserne zu. Er bog in einen zu beiden Seiten mit beschneiten Hecken eingefaßten Richtweg und stellte sich an der ersten Biegung auf. Hier pflegte Roth auf dem Heimweg vorbeizukommen. Schmitz mußte lange auf seinem Posten ausharren, aber es war ihm wohl zu Mute. Die bittere Kälte des Tages war um Mitternacht einer lauen Winterluft gewichen, ein sanfter Wind trieb seine Schneeflöckchen vor sich her und ließ die dürren Blätter der Buchenhecke rascheln. Unten, wo der schmale Weg in die Straße einbog, sah man mitunter eine Gestalt wie einen Schemen schwankenden Schrittes in dem Dunkelgrau der Nacht auftauchen und lautlos auf der weichen Schneedecke wieder verschwinden — Zecher, die nach reichlichem Trunk der Ruhe des Bettes bedurften. — Schmitz fühlte keine Spur von Kälte, denn bei jedem neuen Schlag der fernen Turmuhr trieb ihm das Blut schneller durch die Adern, immer näher rückte der Augenblick, auf den er sich schon so lange gefreut. Endlich, es hatte eben zwei Uhr geschlagen, nahte eine dunkle Gestalt. Der Wartende drückte sich an die Hecke und faßte den Stock fester, das Herz klopfte ihm zum Zerspringen. Schon war Roth auf wenige Meter herangekommen, das Gesicht fast ganz in dem hochgeschlagenen Mantelkragen versteckt, aber Schmitz erkannte den Wachtmeister genau, wie er, einen Gassenhauer vor sich hinpfeifend, mit schleppendem Säbel schwankenden Ganges daher kam. Als der Wachtmeister nur noch einige Schritte hatte, um neben Schmitz zu sein, trat dieser, den Stock auf der Schulter, breitbeinig
  • 72. vor seinen Gegner hin. Roth stutzte einen Augenblick wie ein scheues Wild, dann sah er sein Gegenüber scharf an. Er erkannte ihn nicht. »Was wollen Sie?« brachte er mit trockener Kehle hervor. »Mit dir abrechnen will ich«, war die kurze Antwort, die dem Vizewachtmeister das Blut erstarren machte. Einen Augenblick standen die beiden Männer einander gegenüber, da erkannte Roth seinen ehemaligen Freund. »Ach, du bist es, alter Kerl, was willst du denn hier?« stieß er mit heiserer Stimme hervor. »Das will ich!« schrie Schmitz und ließ seinen Stock sausend durch die Luft fahren. Der erste Schlag traf den Gegner mitten ins Gesicht. Der zum Tod Erschrockene taumelte einen Augenblick, ehe er aber seinen Säbel ergreifen konnte, sauste ihm ein kräftiger Hieb nach dem anderen in's Gesicht, auf den Kopf, die Schultern und Hände. Da stürzte er sich wie ein wildes Tier auf seinen Gegner. Schmitz aber holte aus und gab dem Wachtmeister eine schallende Ohrfeige, daß er rücklings zu Boden fiel. »So, du ehrloser Hund, du feiges, dreckiges Aas, das war für deine gemeine Gesinnung und das ist für deine Lügerei!« Dabei gab er dem am Boden Liegenden einen derben Tritt und entfernte sich. Im Gehen rief er noch spöttisch seinem Opfer zu: »Jetzt darfst du mich wieder melden, du Schweinehund, aber dann habe ich so Verschiedenes zu erzählen!« Nun war dem alten Futtermeister wieder wohl um's Herz, jetzt konnte er sein Schicksal ruhiger tragen, denn er wußte den Gegner gestraft. Die Rache ist doch süß! Vizewachtmeister Roth mußte mehrere Wochen im Lazarett verbringen, bis seine Wunden im Gesicht und an den Händen geheilt waren. Er hatte angegeben, von einem betrunkenen Arbeiter
  • 73. überfallen worden zu sein und behauptete, ihn mit dem Säbel zu Boden gestreckt zu haben. Daran wollte aber niemand recht glauben, denn es meldete sich weder ein verwundeter Arbeiter, noch war ein solcher durch Nachfragen bei den Ärzten der Umgegend festzustellen. Im Stillen wußte jeder, aus welchem Laden der verhaßte Wachtmeister seine Prügel bezogen hatte. Schmitz aber feierte in der Silvesternacht seine Rachetat durch einige Glas Bier, die er sich lange nicht geleistet hatte. Als er beim Schein der Lampe Blut an seiner Hand entdeckte, wischte er es ab wie das eines räudigen Tieres und warf sein Taschentuch in's Feuer. Dann rief er lustig: »Noch eins, Herr Wirt!«
  • 74. Viertes Kapitel. In den letzten Tagen des Januar herrschte in den Räumen des Offizierskasinos rege Tätigkeit. Ein ganzes Aufgebot von Tischlern, Malern und Gärtnern war damit beschäftigt, die Zimmer und Korridore samt Veranda und Wintergarten in einen Festplatz mit zahlreichen Buden und Zelten umzuwandeln, damit Prinz Karneval in den ersten Tagen des Februar einen würdigen Einzug halten könne. Unter dem Dach grünender Bäume waren buntbemalte, mit Plakaten aller Art bedeckte Schaubuden aufgeschlagen, in denen es köstliche Leckerbissen und allerlei Getränke, vom einfachsten Selterwasser bis zum echten Französischen, zu kaufen geben sollte, in einer anderen sollten einige als wilde Tiere frisierte Soldaten in Freiheit vorgeführt werden, ein drittes Zelt war als Bühne hergerichtet, auf welcher man durch Spezialitätenvorstellungen die Lachmuskeln der Festbesucher in Bewegung halten wollte. Zwei mit Bänken besetzte Rasenplätze luden zu den Genüssen einer Musikbande und echten Pilseners ein, während im Nebenzimmer ein Standesamt errichtet war, wo man sich unter Verabfolgung eines Glases Sekt für zehn Pfennig trauen und nach einer Stunde wieder scheiden lassen konnte. Der große Speisesaal stellte den Hauptfestplatz dar. Auf einer mit Zweigen umkränzten Kanzel war Platz für ein Musikkorps, und die Trompeter des Regiments schweiften täglich in der ganzen Gegend umher, um irgendwo ein recht zerlumptes Musikantenkostüm aufzutreiben. Sogar eine Photographierbude fehlte nicht, an deren Außenwand die verlockendsten Porträts und Gruppenbilder zu sehen waren. Natürlich bildete die bevorstehende Festlichkeit den Hauptgesprächstoff während des Offiziersmittagstischs. Jeder wollte
  • 75. so originell als möglich angezogen erscheinen, und es war ein langes Hin- und Herberaten, bis man sich über das zu wählende Kostüm schlüssig wurde. So kam der Tag des Festes allmählich heran. Am Nachmittag traf ein kleines Heer von Friseuren ein, und der Regimentsschneider zog mit seiner Nadelgarde von einem Herrn zum anderen, um noch Änderungen an den Kostümen vorzunehmen oder mit hülfreicher Hand einzugreifen, wo etwas nicht paßte. Um sieben Uhr erwarteten die Ordonnanzen in schwarzen Kellnerfräcken die Festteilnehmer, und es währte keine halbe Stunde, bis die Herren und Familien des Offizierkorps mit ihren Gästen vollzählig erschienen waren. Es bot ein buntes, farbenprächtiges Bild, wie sie alle in ihren mehr oder minder geschmackvollen originellen Verkleidungen durcheinanderwogten, während die Musik aus den verschiedenen Ecken des Festplatzes ihre Tanzweisen ertönen ließ. Dabei floß der Sekt in Strömen, und an einem Gartentische sah man sogar einen derben Bauern, den Knotenstock zwischen den Beinen, eine Portion Kaviar verzehren, während daneben ein Zirkusklown einen Hummer zerlegte. Die drolligste Figur aber war der Kommandeur in seinem polnischen Bauernkostüm, mit der Pelzkappe auf dem Kopf. Wäre er in dieser Verkleidung auf dem Schweinemarkt in Pommern erschienen, hätte jeder Käufer einen bedeutenden Borstentier-Züchter in ihm vermutet, mit dem es sich lohnte, einen Handel anzufangen. Es machte ihm sichtlich auch keine Mühe, durch entsprechende Gebärden und Bewegungen die Treue seiner Rolle zu erhöhen. Da der Sekt auf allgemeine Unkosten ging, war der Herr Oberst schon nach einer Stunde »veilchenblau«. Sein hoher Adjutant hatte nicht gut daran getan, die Verkleidung eines polnischen Juden zu wählen, denn auf diese Weise ersetzte er geschickt, was seinem Äußeren am waschechten Mauschel noch fehlte.
  • 76. Frau König sah als Kammerzofe reizend aus, und ihre blauen Augen strahlten vor Vergnügen. Wäre es im Ernst gewesen, so hätte die niedliche blonde Dirn mit dem lebensfrohen frischen Gesichtchen sofort eine Stellung mit hohem Lohn gefunden. Dies erkannte auch der Jägerbursch, dessen Züge denen Bleibtreu's auffallend ähnlich waren, und er beschloß, mit dem sauberen Mädel »zu gehen«, um sich dann mit ihm zum Standesamt zu begeben. Erst das Ende des Festes machte einen Strich durch die so schönen »Flitterstunden« des jungen Paares und führte ihm die rauhe Wirklichkeit in Gestalt des zum Aufbruch mahnenden Gatten vor Augen. Auch Frau Leimann erschien als Vierländerin nicht minder begehrenswert. Das Kostüm stand ihr gut, und Borgert weidete sich mit sichtlichem Behagen an der schönen Figur und den kleinen Füßchen seiner Hausgenossin. Frau Kahle kokettierte als Blumenmädchen mit den jüngeren Herren, indem sie aller Augen auf den Ausschnitt ihres Kleides zog, an welchem sie eine herrliche Rose befestigt hatte. Auch sie spielte ihre Rolle vortrefflich, denn der Sekt ließ bereits eine befriedigende Wirkung erkennen. Leutnant Kolberg als Modegigerl hatte ihr bereits alle Blumen abgekauft und sie dann als »Arbeitslose« gänzlich mit Beschlag belegt. Frau Rittmeister Stark allein paßte gar nicht in das Milieu des Festplatzes hinein. Die Wahl ihrer Gewandung hatte ihr heftiges Kopfzerbrechen verursacht, denn als Blumenmädchen oder Balletteuse zu erscheinen, schien ihr zu gewagt. Die Rolle einer Äpfel- oder Butterfrau fürchtete sie als zu naturgetreu, und so schwebte sie denn in einem schillernden Phantasiekostüm durch die Menge, das sie auf Befragen neckisch für das einer »Nixe in mittleren Jahren« erklärte. So hatte sie sich in eine Wolke rosa und mattgrüner Spitzen gehüllt, und der gewaltige Busen schien die Meereswogen darzustellen, während die bloßen Arme eigentlich mehr den Eindruck machten, als seien sie das Handwerkszeug einer »Kraftmenschin« oder Riesendame.
  • 77. Drei jüngere Herrn bildeten ein vortreffliches Vagabunden-Kleeblatt, und man konnte glauben, die zerlumpten Gesellen hätten sich meuchlings von der Landstraße eingeschlichen, um einmal ein Fest der »oberen Zehntausend« mitzumachen. Die zu ihrer Rolle passende Trunkenheit hatten sie sich in kürzester Zeit angeeignet. Leutnant von Meckelburg stand als Leierkastenmann unbeweglich in einer Ecke und konnte sich nicht entschließen, an dem lustigen Treiben teilzunehmen, dabei machte er ein Gesicht, welches nicht unmittelbar auf die Anwesenheit von Geist schließen ließ. Erst als er in späterer Stunde seine musikalische Dekoration in einem Winkel des Festplatzes verborgen, stellte sich allmählich etwas Geist ein, der aber dem Grunde einer geleerten Sektflasche entstammte. Die Musik spielte die schönsten Tanzweisen und benutzte die Pausen zu intensivem Studium des Bierfasses, dessen Hahn aus dem Tannengrün ihres Podiums herauslugte. Um 11 Uhr begann die Festvorstellung auf der kleinen dazu errichteten Bühne. Ein Leutnant trug als Einleitung zwei prinkelnde Kouplets vor, indem er als anmutige Chansonette in einem reichlich dekolletierten Babykleidchen auf der Bühne herumhüpfte. Daran schloß sich die Aufführung einer Parodie auf Shakespeares »Hamlet«, in deren Verlauf sämtliche Mitwirkende durch Mord, Gift, Blitz, Hunger und Durst elendiglich zu Grunde gehen. Zum Schluß trat sogar der Souffleur auf die Bretter und gab, erschüttert durch die vor seinen Augen sich abspielenden Greuel, seinem inhaltlosen Leben durch freiwilligen Sturz in die Versenkung einen würdigen Abschluß. So war die Stimmung immer anregender geworden und allmählich unterschied sich die Fastnachtsfeier des Offizierkorps nur noch durch den immer noch strömenden Sekt von dem Treiben auf einem wirklichen Festplatz zur Zeit der Dorfkirmes. Leutnant Kolberg hatte sich inzwischen mit Frau Rittmeister Kahle in einer Laube niedergelassen und eine Rollschutzwand davorgestellt, um ungestört und ungesehen ein trautes Stündchen zu verbringen.
  • 78. Eine kleine »Flirtation« war ihm Lebensbedürfnis, und, da die Garnison mit ihren soliden Bürgerstöchtern und ehrbaren Frauen seinen diesbezüglichen Ansprüchen nicht gerecht wurde, wollte er einmal hier sein Heil versuchen. Er wußte ja von Pommer her, wes Geistes Kind Frau Grete war und wollte nun auf diplomatischem Wege das Feld sondieren. Die dazu erforderliche Zeit aber hatte er zu lange bemessen, denn schon nach einer Viertelstunde lag die kleine Frau wonne- und liebestrunken in seinen Armen und wehrte sich nicht im Geringsten, als der feurige Galan die Rose am Busen seiner neuen Geliebten einer eingehenden Besichtigung unterzog. Das war doch ein anderer Kerl wie sein unbeholfener Vorgänger, der hatte Mut und Feuer, und sie malte sich ein Liebesleben mit dem neu eroberten Romeo in den glänzendsten Farben. In einer anderen Laube saß Oberleutnant Leimann ganz allein und vergoß Bäche von Tränen. Das heulende Elend hatte ihn wieder pünktlich nach dem sechsten Glase gepackt. Jeden tröstlichen Zuspruch wies er schroff zurück, und die Ordonnanzen wollten sich tot lachen, wenn sie den heulenden ungarischen Magnaten wie ein Häuflein Unglück auf einem Weinfaß sitzen und herzbewegend schluchzen sahen. Seine Gattin fand die Situation höchst langweilig und beschloß daher, einen Migräneanfall zu bekommen. Sie nahm also mit müden Zügen in einer anderen Ecke Platz und bat den sofort hinzukommenden Borgert, sie nach Hause zu bringen. Durch diesen Auftrag nicht unangenehm berührt, bot er der schönen Vierländerin den Arm, geleitete sie zur Garderobe, warf ihr den Pelzmantel über die Schultern und geleitete sie nach Hause. Als sie vor der Tür des gemeinsamen Hauses standen, tat sie einen tiefen Seufzer und sagte leise: »Die Luft hat mir gut getan! Es ist mir wieder wohl!«
  • 79. »Also darf ich Sie wieder zum Kasino zurückbegleiten?« war Borgert's Antwort, und der Ton seiner Stimme verriet sichtliche Enttäuschung. »Ach nein, wir wollen bei mir noch eine Tasse Kaffee trinken, das wird uns gut tun, ich habe auch gar keine Lust, wieder unter diese betrunkenen Menschen zu gehen, es ist ein widerwärtiger Anblick!« »Ganz wie Sie wünschen, meine Gnädigste!« Dabei schob er den Schlüssel in das Schloß, öffnete die Tür, und beide stiegen schweigend die dunkle Treppe hinauf. Als sie im Zimmer angelangt waren, holte Borgert die Lampe herbei und zündete sie an. Er kannte genau den Platz, wo sie zu finden war. Dann griff er nach einer Zeitung und setzte sich träge in die Sofaecke. Frau Leimann aber war im Nebenzimmer verschwunden, um nach wenigen Augenblicken wieder mit der Kaffeemaschine zu erscheinen, auch hatte sie das Fastnachtskostüm mit dem Morgenrock vertauscht, dessen weicher Faltenwurf sich kosend an die schönen Glieder schmiegte. »So,« sagte sie, die Gardinen zuziehend, »jetzt sind wir endlich in unseren vier Pfählen, jetzt wollen wir noch ein Stündchen gemütlich plaudern!« Dabei ließ sie sich ebenfalls auf das Sofa fallen, und Borgert's Augen hingen wie trunken an der jugendlich schönen Gestalt, die sich unter dem Stoff des Gewandes verriet. »Endlich allein! könnte man eigentlich sagen,« scherzte Borgert, »hoffentlich kommt Ihr Gatte nicht zu bald nach, damit unser idyllisches Kaffeestündchen nicht gestört wird.« »Mein Mann?« erwiderte Frau Leimann mit spöttisch emporgezogenen Lippen, »der kann bleiben wo er ist, wie ich ihn kenne, kommt er vor morgen früh auch nicht nach Hause. Ich habe den Menschen schrecklich satt! Ich kann ja zu Ihnen offen reden!«
  • 80. »Ja, gnädige Frau, das sind eben die Freuden und Leiden des Ehestandes. Drum prüfe, wer sich ewig bindet, sagt Schiller, denn sonst gibt es eben ein Unglück!« »Sie haben gut reden! Man kann doch in den paar Wochen, die man verlobt ist, nicht seinen Zukünftigen so kennen lernen, wie man es in der Ehe tut. Hätte ich das gekonnt, dann hätten wir nicht diese Dummheit begangen, uns zu heiraten. Denn ich bin ihm jetzt zu arm und er wird mir allmählich unausstehlich!« »Darum heirate ich nie, ich lasse die Finger von diesem Hazardspiel!« »Aber man ist doch schließlich dazu da!« erwiderte Frau Leimann fast gereizt, »man will doch später nicht als alte Jungfer zum Gespött der Leute werden.« »Nach unseren Gesetzen und gesellschaftlichen Regeln hilft es eben nichts, gnädige Frau, da heißt es entweder heiraten oder ledig bleiben. Aber das ist entschieden eine Lücke in unserer Weltordnung. Wie wenige sind es, die, nach langjähriger Ehe vor die Frage gestellt, ob sie sich noch einmal heiraten würden, mit einem aufrichtigen »Ja« antworten könnten! Meistens würde man doch die Gelegenheit benutzen, auseinander zu laufen. Ich setze dabei also voraus, daß es eine Bestimmung gäbe, die nach beispielsweiser zehnjähriger Ehe diese trennen und den Gatten eine nochmalige gegenseitige Heirat gestatten würde.« »Sie haben Recht, manche möchten schon nach den ersten Wochen wieder auseinander, aber sie müssen weiter neben einander her vegetieren, weil sie durch die sogenannte Ehe zusammengebunden sind.« »Das wäre etwas voreilig gehandelt, gnädige Frau, denn viele Ehegatten müssen sich erst an einander abschleifen und ganz genau kennen, um sich schätzen zu lernen, wozu oft lange Jahre gehören, und dann kommt es doch häufig vor, daß sie in späteren Jahren recht gut miteinander auskommen, während sie früher wie Hund und Katze standen.«
  • 81. »Gewiß, aber wenn nach zehn Jahren keine Liebe da ist, dann kommt sie auch nicht mehr!« »Das möchte ich beinahe auch glauben,« lachte Borgert, »man sieht eben, die Ehe ist keine zeitgemäße Einrichtung. Sie mag gut sein für zwei Menschenkinder, die äußerer Vorteile wegen, wie sie auch sein mögen, sich heiraten. Aber für Menschen, die nur zusammenkommen, weil sie glauben, sie lieben sich, ist es nichts, denn wenn die Liebe vorbei ist, ist die Ehe nur ein Martyrium. Und deswegen sollte es für solche, die sich näher treten wollen, eine andere Einrichtung geben, als sie dann gleich fürs ganze Leben aneinander zu fesseln!« »Sie meinen also dann, an Stelle der Ehe sollte man die sogenannte »freie Liebe« einführen?« »Gewiß, gnädige Frau, entweder das, oder, wenn dies aus irgend welchen Gründen nicht ratsam erscheinen sollte, eine Einrichtung schaffen, wie sie die Orientalen haben. Hat dort ein Mann sich an einer Frau gesättigt, wenn ich mich drastisch ausdrücken soll, so geht er einfach zur nächsten über, denn er darf sich ein ganzes Hans voll halten. Aber er wird einer einzelnen gar nicht so schnell überdrüssig, weil er eben Abwechslung in der Liebe haben kann. Und man kann doch keinen Menschen zwingen, sein ganzes Leben nur immer denselben oder dieselbe zu lieben!« »Da schiene mir denn doch die freie Liebe noch ratsamer, wenn Sie einmal die Einzelehe verwerfen wollen, denn sie wäre noch weniger durch Grenzen und Gesetze beengt, wie es die orientalische Ehe trotzdem ist.« »Selbstverständlich, welchen Unsinn und widernatürlichen Zwang unsere Ehe bedeutet, sehen Sie, wenn Sie ihr Wesen einmal genau definieren. Was heißt Ehe? Ein Bündnis zwischen Mann und Frau, die sich lieben oder deren äußere Verhältnisse eine Verbindung ratsam erscheinen lassen. Dabei machen Kirche und Gesetz, manchmal auch nur letzteres allein, dieses Bündnis, Ehe genannt, zu einem rechtmäßigen.
  • 82. Aber erstens: die sich lieben. Tun sie das immer und dann durch das ganze Leben? Nein, nur in der Minderzahl der Fälle bleibt eine etwa zu Anfang vorhandene Liebe bestehen, aber die Ehe ist von Gott und Natur dazu bestimmt, Liebende zu verbinden. Tut sie das nicht, ist es Unsinn. Zweitens: eine Ehe zwischen äußeren Umständen gibt es auch nicht, denn um aus gemeinsamen Vorteilen, oder wie Sie es nennen wollen, Gewinn zu haben, ist Handel und Geschäft der richtige Weg, aber nicht die heilige Ehe. Drittens: eine Ehe, in welcher die Liebe schwinden kann, ist ebenfalls hinfällig, denn man muß bei der Trauung dem Pfarrer, gewissermaßen also dem Stellvertreter Gottes, das eidliche Versprechen geben: wir wollen uns das ganze Leben in Liebe angehören. Dieser Eid ist also sofort in einen Meineid verwandelt, wenn die Liebe schwindet. Und wie kann man mich denn zwingen, etwas zu schwören, von dem ich noch gar nicht weiß, ob ich es zu halten im stande bin? Wider die Natur kann doch kein Mensch! Der Begriff Ehe ist also abgetan. Was haben nun weiter Gesetz und Kirche mit der Verbindung zweier Menschen zu tun, die sich lieben? Die Kirche gibt ihren Segen dazu und soll den Bund heiligen. Das ist aber überflüssig und lediglich eine Formsache, denn das Gefühl der Weihe, wie es die Trauung einflößen soll, haben zwei Menschen von selbst, die sich wirklich gern haben und den Entschluß fassen, sich zu verbinden. Ferner, ein Gesetz muß es ja geben, denn es bildet die Norm für auseinandergehende Ansichten, und ohne Gesetz ist kein Staat, kein gemeinschaftliches Wirken zweier oder mehrerer Menschen denkbar. Die Liebe als solche aber, wie sie allein zwei Gatten zusammenführen soll, braucht keine Gesetze, denn diese sind von der Natur aufgestellt. Ein Gesetz schreibt Handlungen oder Unterlassungen vor, gibt Anhaltspunkte für das menschliche Zusammenleben und Wirken, Gefühle aber kann es nicht vorschreiben, also auch nicht rechtskräftig machen.
  • 83. Zwei Menschen also, die sich wirklich lieben und fühlen, daß sie zusammen gehören, verbinden sich am natürlichsten durch die freie Liebe!« »Aber warum sollen sie sich denn nicht heiraten, wenn sie unbedingt glauben, zusammen zu gehören?« warf Frau Leimann ein. »Weil sie der Kirche keinen falschen Eid geschworen haben, wenn die Liebe einmal schwindet, auch können sie dann ruhig wieder auseinander gehen.« »Aber dafür gibt es doch die Scheidung!« »Gewiß, die gibt es. Eine Scheidung aber wirbelt meist so viel Staub auf und hat oft so nachteilige Folgen für die Beteiligten, daß sie lieber jahrelang in gegenseitigem Überdruß, oder gar in Haß und Verachtung neben einander leben, als sich zur Scheidung entschließen. Abgesehen von den großen gesetzlichen Schwierigkeiten einer solchen ist es aber auch meist schwer, die nun einmal verbundenen äußeren Umstände, Vermögen u. s. w. zu trennen. Hört freie Liebe auf, so geht man stillschweigend wieder auseinander und führt nicht jahrelang ein widernatürliches Leben in einer sogenannten Ehe. Auch werden sich Mann und Frau, solange wahre Liebe zu einander vorhanden ist, nicht gegenseitig mit einem anderen betrügen, und damit wäre viel Unglück und Sünde aus der Welt geschafft.« »Aber dann müßte ja jeder gesellschaftliche Familienverkehr aufhören, denn die Männer eines gemeinsamen Wirkungskreises, z. B. eines Offizierkorps oder die Beamten eines Gerichtes würden dann aus so verschiedenen Schichten der Gesellschaft oder des Volkes ihre Frauen wählen, daß diese gar nicht zusammen passen würden!« »Das wäre kein Hinderungsgrund, gnädige Frau: die zu einander passen, könnten doch miteinander verkehren. Die übrigen bleiben sich eben gegenseitig fremd. Oder finden Sie es etwa schön, daß Frauen, die sich innerlich ganz fern stehen und bleiben, jeden Tag
  • 84. wie dicke Freundinnen zusammensetzen, weil es der gesellschaftliche Verkehr verlangt?« »Das finde ich allerdings nicht schön, man braucht sich ja nur einmal unsere Damenkaffees zu betrachten.« »Die Wahl der Frau in der freien Liebe ist an keine Gesellschaftsklasse gebunden, weil dann die Frau dem Manne eben nicht dazu dient, sich äußere Vorteile in Stellung oder pekuniärer Beziehung zu schaffen oder um mit ihr Staat zu machen, sondern nur für die Liebe, also für das engere Leben in Haus und Familie.« »Aber die Ehe ist doch eigentlich nur die Form für ein Naturgesetz, daß nämlich das Menschengeschlecht erhalten wird.« »Stimmt, aber dieses Naturgesetz wird weit besser durch die freie Liebe als durch die Ehe gefördert. Nehmen Sie eine Ehe, in welcher die wirkliche Liebe der Gatten zu einander geschwunden ist, oder sie sich vielleicht sogar überdrüssig sind. Scheiden lassen wollen sie sich nicht, aber Kinder werden doch in die Welt gesetzt, eins nach dem anderen. Diese aber sind keine Kinder der Liebe, und ihre Erziehung, Charakter- und Gemütsbildung muß doch darunter leiden, wenn sie keine inneren Beziehungen, keine Herzens- und Seelenverwandschaft der Eltern empfinden, denn dahinter kommt ein Kind sehr bald. Aber auch die Kinderzahl würde sich in der freien Liebe verringern, denn ein Mann, der seine Frau wirklich lieb hat, macht keine Maschine aus ihr, und glauben Sie nicht, daß zum Glück einer Ehe schon zwei Kinder genügen? Jedes weitere bringt nur Last und Sorge. Wenn aber, besonders in niederen Volksklassen, die Kinderzahl abnimmt, ist auch gleichzeitig eines jener Grundübel beseitigt, die den Sozialismus fördern.« »Nun nehmen Sie aber eine Ehe, die fünf Kindern das Leben gibt und setzen Sie statt der Ehe die freie Liebe: Der Mann wählt jedes Jahr eine andere Frau, das lassen Sie zwanzig Jahre so fortgehen und es gibt unter normalen Umständen zwanzig Kinder statt fünf. Was soll aus ihnen werden? Der Mann kann doch nicht jedesmal in
  • 85. sein neues Liebesverhältnis die jährlich wachsende Kinderzahl mitbringen und sie alle großziehen!« »Betreffs der Kinder der freien Liebe könnte es ja ein Gesetz geben, welches dem Vater dieselben Verpflichtungen auferlegt, wie sie für außereheliche Kinder bestehen. Dann würde er sich schon einzurichten wissen, wenn er zu regelmäßigen, seinem Einkommen entsprechenden Geldopfern gezwungen wäre.« »Und wenn der zweiten Frau nicht paßt, daß er das Kind des ersten Verhältnisses mitbringt?« »Dann könnte man Erziehungshäuser in großem Styl errichten. Schon unter den jetzigen Verhältnissen wäre es oft gut, wenn ein Kind nicht bei den Eltern aufwüchse, die nicht harmonieren, und so dem jugendlichen Gemüt Eindrücke zu teil werden, die ihm nicht von Nutzen sind. Indeß nennt man ja Kinder das Unterpfand der Liebe, sie würden das einmal eingegangene Verhältnis erhalten helfen.« »Dann kämen wir also wieder auf die Ehe zurück!« »Gewiß, aber auf eine Ehe, die wir jeden Tag selbständig lösen dürfen. Wir Menschen tun gut, uns in allem an die Natur zu halten, an ihr künsteln und bessern zu wollen, hat meist den entgegengesetzten Erfolg. Ein Tier tritt auch nicht vor den Altar oder den Standesbeamten, wenn es sich mit einem anderen paaren will. Sind sie von einander gesättigt, läuft das eine wieder nach Süden, das andere nach Norden.« »Wir sind aber doch mehr wie Tiere!« lachte Frau Leimann. »Dafür haben wir auch die Liebe, ein Tier kennt nur Triebe!« Frau Leimann schwieg. Ein so ernstes Gespräch hatte sie lange nicht geführt und es machte ihr fast Mühe, dem Gedankengang zu folgen. Schien ihr auch mancher Punkt noch anfechtbar, im Grunde war es doch richtig mit dieser freien Liebe, und sie bedauerte beinahe, daß
  • 86. man in der Kultur noch nicht so weit gekommen sei. Das wäre eher nach ihrem Geschmack gewesen, als die Ehe mit so einem langweiligen, häßlichen Mann, wie ihr Gatte war, mit so unendlich vielen schlechten Eigenschaften. Sie besaß auch genügend Feingefühl, um mit dem schlauen Verstand einer Frau zu empfinden, wo hinaus Borgert mit Entwickelung dieser seiner Ansichten wollte. Sie warf daher ihr erhitztes Köpfchen auf, blinzelte verschmitzt den Apostel der freien Liebe von der Seite an und fragte mit erheuchelter Unbefangenheit: »Nun, sagen Sie, wenn eine Frau schon verheiratet ist, also bereits durch eine Gesetzesehe gebunden, und kommt nun nachträglich zur Einsicht, daß die freie Liebe besser ist? Was dann?« »Dann mag sie ihrer Einsicht folgen, nur darf sie es nicht so offenkundig vor aller Augen tun, da sie es eben nach den vorläufig noch bestehenden Grundsätzen über eheliche Treue nicht darf. Sie muß es machen wie die Pariserin.« »Dann wird es aber Zeit, daß ich mich nach einem solchen heimlichen Romeo umsehe, denn mein Gesetzlicher wird mir allmählich unheimlich!« rief Frau Leimann belustigt. »Kann ich Ihnen dabei behilflich sein, Gnädigste?« entgegnete Borgert ebenfalls scherzend. »Sie würden es sich damit wahrscheinlich wieder leicht machen, denn, wenn ich mich recht entsinne, stellten sie sich schon einmal freundlichst zur Verfügung!« »Womit ich auch in diesem Falle meine Dienste beginnen würde!« »Dann könnte ich ja mit Ihnen einmal die neue Theorie probieren, schade, daß kein heimlicher Standesbeamter da ist. Aber nein, den haben Sie ja als überflüssig verworfen.« »Nein, den brauchen wir nicht, wir machen die Sache unter uns ab!« sagte Borgert scherzend. »Bedarf es denn gar keiner Formalitäten?«
  • 87. »Gewiß, sogar vieler, und zwar derselben wie beim Abschluß einer richtiggehenden Ehe!« »Ach so, Sie meinen einen Händedruck und einen innigen, tränenfeuchten Blick?« »Auch das gehört dazu.« »Auch? Was denn noch? Ich habe so ein schlechtes Gedächtnis.« »Ich will es Ihnen ins Ohr sagen, rücken Sie etwas näher!« Frau Leimann rückte dicht neben Borgert und sagte, unbefangen scherzend: »Das scheint ja eine große Heimlichkeit zu sein!« Sie beugte ihren Kopf zu Borgert hin, welcher in diesem Augenblick mit beiden Armen die schöne Frau umschlang, während seine Lippen die ihren suchten. Da schlang auch sie die Arme um den Mann, und lange hielten sie sich so umschlungen, während ein heißer, glühender Kuß all die verhaltenen Gefühle der Liebe auszuströmen schien, die lange beider Herzen erfüllt. Die Lampe war schon im Erlöschen begriffen, als ein unsicherer, schwerer Schritt auf der Treppe vernehmbar ward. »Er kommt!« stieß Frau Leimann erschrocken aus, »Du mußt dich eilen, daß er dich nicht hört!« Eine letzte Umarmung, und Borgert huschte durch das Speisezimmer dem anderen Ende des Korridors zu, um über die Hintertreppe nach seiner im Erdgeschoß gelegenen Wohnung zu gelangen. An der Tür aber zog er behend die Schuhe aus und tappte leise die dunkle Treppe hinab. Frau Leimann aber blies die Lampe aus, stellte Borgerts Kaffeetasse unter das Sopha und legte sich wie schlafend in die weichen Kissen zurück.
  • 88. Inzwischen hatte Leimann geräuschvoll die Korridortür geöffnet und trat jetzt in das Zimmer, wo die Gattin seiner harrte. Einen Augenblick blieb er am Eingang stehen. Roch es hier nicht nach Zigarettenrauch? Dann tastete er mit den Händen nach dem Tisch, ergriff die Streichholzschachtel und zündete eine Kerze an. Da erblickte er seine Gattin auf dem Sofa. Der Anblick rührte ihn. Hatte die treue Seele auf ihn gewartet, um ihm noch eine Tasse Kaffee anzubieten? Gewiß war sie vor Müdigkeit entschlummert und hörte ihn nicht, als er nach Hause kam. So trat er denn behutsam an das Sofaende und küßte seine Frau auf die Stirn. Mit einem leichten Schrei fuhr sie empor. »Ach du bist es, Georg, wo bleibst du so lange?« »Sei mir nicht böse, mein Engel, daß ich dich warten ließ, aber ich ahnte ja nicht, daß du meinetwegen aufbleiben würdest. Warum hast du dich nicht gelegt?« Aus den Worten klang ein liebevoller Ton, sie schienen wie eine Entschuldigung, eine Bitte um Verzeihung; Frau Leimann aber wischte sich den Schlaf aus den Augen und erhob sich müde. »Ich mußte doch auf dich warten, Georg, du warst wieder in einem schrecklichen Zustand. Als ich dich so sitzen sah, wurde mir so elend, daß ich es nicht mehr aushalten konnte, und ging nach Hause!« »Allein, so spät, in der Nacht? Warum hast du dich nicht von einer Ordonnanz begleiten lassen?« »Borgert hat mich bis an die Tür gebracht, er bot mir seine Begleitung an!« »Dafür muß ich mich morgen bei ihm bedanken, er ist überhaupt immer sehr aufmerksam gegen dich! Wo ist er denn geblieben, ich habe ihn nicht mehr gesehen den ganzen Abend!«
  • 89. Welcome to our website – the perfect destination for book lovers and knowledge seekers. We believe that every book holds a new world, offering opportunities for learning, discovery, and personal growth. That’s why we are dedicated to bringing you a diverse collection of books, ranging from classic literature and specialized publications to self-development guides and children's books. More than just a book-buying platform, we strive to be a bridge connecting you with timeless cultural and intellectual values. With an elegant, user-friendly interface and a smart search system, you can quickly find the books that best suit your interests. Additionally, our special promotions and home delivery services help you save time and fully enjoy the joy of reading. Join us on a journey of knowledge exploration, passion nurturing, and personal growth every day! ebookbell.com