Java™ Thin-Client Programming for a
Network Computing Environment
JÜRGEN FRIEDRICHS HENRI J I B I N AND THE JALAPENO TEAM
/ - • : / : . . : : • . • - - •
ISBN 0-13-011117-1
List of Figures, xiii List of Tables, xix Preface, xxi
The Team That Wrote This Book, xxiv The Jalapeno Team, xxv
Comments Welcome, xxvii
Chapter I Introduction, 1
A Thin Client Application—The Lunar Medical Center Story, 3 About the Book, 4
Who Should Read This Book, 7 Assumptions, 7
Java Thin-Client Programming for a Network Computing Environment
Chapter 2
Network Computing and Network Computers, 9
Network Computing Ideals, 11 Network Computing Reality, 12
Problems with Network Computing, 13
The Network Computer (NC), 14 NC Objectives, 15
NC Capabilities and Architecture, 16
NC Product Example: The IBM Network Station 1000,18
A Network Computing Strategy, 21
Chapter 3
Distributed Applications, 23
The Monolithic, Nondistributed Alternative, 24 A Look at Some Issues, 25
Considering Distributed Systems Design & Development Strategies, 29
In Summary, 34
Chapter 4
HTML-Based Clients, 35
Browsers a n d Web Servers, 37 HTML Overview, 39
HTML Conformance, 39 Developing in HTML, 40 Simple Example, 41 Forms and Tables, 42
To Validate or Not to Validate..., 44
Client Intelligence—JavaScript, 45
Simple JavaScript Examples, 47 Using JavaScript, 50
Java-Based Clients, 55
A Brief Overview of Java, 56
Client-Server Computing with Java, 61
Applets, 61
Sockets in Java, 63
Accessing an HTTP Server with Java, 66
Object-Object Communication: Remote Method Invocation (RMI), 66 Connecting to the Database: JDBC, 67
The Lunar Medical Center's Java Application, 69 The Lunar Medical Center's Java Applet, 73
Some Java Facilities Supporting Enterprise-Wide Network Computing, 76
In Summary, 79
Chapter 6
Design Decisions, 81
Designing the Object Model for the Lunar Medical Center's Systems, 82
Designing the Applications: Considering Alternatives, 85
Profiles Describing the Check-In Applet, 85
Profiles Describing the Main Patient View/Edit Application, 86 Profiles Considered but Not Implemented, 87
Additional Factors to be Considered, 87
The Lunar Medical Center Implementations, 88
Nondistributed Full Application Based on Files, 90
HTML Only at the Browser with a Servlet at the Server, 91 HTML and JavaScript with HTTP to a Servlet, 92
Applet at the Browser with HTTP Connection to Java Servlet, 93 Applet with Direct JDBC Connection, 94
Java Application Using JDBC Directly, 95 Full Application Using Sockets, 95
Full Java Application Using Java RMI, 96
Java Thin-Client Programming for a Network Computing Environment
Chapter 7
Java Servlets and HTTP Communication, 99
Overview of the Hypertext Transfer Protocol a n d Request Methods, 100
Protocol Steps, 101
HTTP Headers and Server Status Codes, 103 Client Request Methods 106
Common G a t e w a y Interface, 108
Using CGI, 109
Problems with CGI, 111
Java Servlets, 111
Servlet Requirements and Usage, 112
The LMC's HTTP/Servlet Implementation, 117
In Summary, 120 Chapter 8
Java Servers Using JDBC, 123 Overview of JDBC, 124
JDBC API, 125
JDBC/SQL Data Type Mapping, 126
JDBC Database Drivers, 128
Using JDBC, 130
The LMC's JDBC Implementation, 133
Chapter 9
Java Servers and Socket Communication, 141 Introduction to TCP/IP sockets, 142
Sockets with Java, 144
Compatibility of Different Socket Implementations, 144
The LMC's Socket Implementation, 145
Implementing the Socket Client, 146 Implementing the Socket Server, 147
Applications, 151
The RMI Architecture, 152
Stub and Skeleton Layer, 153 Remote Reference Layer, 154 Transport Layer, 154
RMI Method Invocation Mechanism, 154
RMI from a Programmer's Perspective, 155
Server Side, 155 Client Side, 155
RMI Security Manager, 158 RMI Registry, 158
Major RMI Classes, 158 Developing with RMI, 159
The LMC's RMI Implementation, 161
The RMI Server Interface, 161 The RMI Server Class, 162 The RMI Client Class, 164
In Summary, 165
Chapter I I Client Diets, 167
Looking at the Options, 168
The Compiler and Tools, 169
Packaging, Class Loading and Pre-Initialization, 170 Object Recycling, 172
Garbage Collection, 173
Optimizing Memory Accesses, 175 Synchronization Overheads, 176 Error Handling, 178
Other Issues and Optimizations, 178
Java Thin-Client Programming for a Network Computing Environment
Chapter 12 Tasty Additions, 181
Introduction to SmartCards, 181
The SmartCard File System, 185 The OpenCard Framework, 186 Sample SmartCard Application, 189
Accessing a Serial Port, 192
X-10 Architecture and Protocols, 193
Programming the X-10 CP290 Home Control Interface, 193 The Java Espresso Machine Example, 194
Chapter 13
NC Deployment: Using IBM Network Stations, 197 Introduction, 198
Software Requirements, 198 The Initialization Process, 199
The Power-On Self-Test, 200 Locating the Boot Server, 201 Loading the Kernel, 202 Initiate the Environment, 203
IBM Network Station Set Up, 204
The NVRAM Setup Utility Panel, 204 Set Network Parameters Panel, 205
Set the Boot Parameters Panel 208
The IBM NetworkStation Manager, 210 The Configuration Files, 212
The Configuration File Syntax, 212 System-Level Configuration Files, 213 Workstation-Level Configuration Files, 214 User-Level Configuration Files, 215
The Startup Files, 215
The IBM Network Station User Services, 216 The IBM Network Station Message Log, 218
Accessing the Serial Port, 221
Allowing Access to the Serial Port, 222 Initializing the Serial Port, 222
Coming Soon: IBM Software Release 3, 224
The Setup Utility Panel, 224
IBM Network Station Manager, 224 Java Support, 224
Chapter 14
Java in the IBM Network Station, 227 Introduction, 227
Java Virtual Machine, 228 Memory Requirements, 228 Java Settings, 229
Running J a v a Programs in the IBM Network Station, 229
Adding a Java Applet Item to the Taskbar, 230 Adding a Java Application Item to the Taskbar, 231 Autostarting Java Programs and Applets, 233
Troubleshooting Java Execution Problems, 234 The eSuite, 236
The Workplace, 236 The Administrator, 238 Adding a Java Applet, 239
Appendix A
Brief HTML Reference, 247 Top Level Tags, 247
Character Formatting Tags, 248 Block Formatting Tags, 248 Table Tags, 249
Jovo Thin-Client Programming for a Network Computing Environment
Forms Tags, 251
Miscellaneous Tags, 252
Appendix B
Java Development: Using VisualAge for Java, 255
The VisualAge Family, 256
VisualAge for Java Overview, 257
Integrated Development Environment (IDE), 260
Java Support, 260
Navigating within VisualAge for Java, 263 Starting VisualAge for Java, 264
How It Fits Together, 271 Extending the Application, 287 Team Development, 294 Applet Viewer, 297
Editor•/Debugger/SmartGuides, 299 Other VisualAge for Java Windows, 305 SmartGuides/Wizards, 306
Proxy Builder, 307
Enterprise Access Builders (EAB), 308
Data Access Builder (DAX), 308
System Requirements, 309 Summary, 310 Appendix. C Special Notices, 311 Appendix D Related Publications, 315
International Technical Support Organization Publications, 315 Redbooks on CD-ROMs, 315
How IBM Employees Can Get ITSO Redbooks, 317 How Customers Can Get ITSO Redbooks, 318 IBM Redbook Order Form, 320
List of Abbreviations, 321 Index, 325