note: boldface numbers indicate...
TRANSCRIPT
INDEX
// comments, 81, 98-99
Aabs, 140%ABS in RPG, 138absolute (abs) in Java, 138abstract
classes, 360inheritance and, 379, 380-382interfaces and, 389methods, 360, 418new operator and, 381threads and, 451in user interface, Swing classes and, 489
Abstract Windowing Toolkit (AWT), 488AbstractButton class, 502accessibility of Java, 6
accessor rights (see modifiers in Java)accessors (see getter methods)acos, 140ActionListener, 511-514actionPerformed method, 402actions associated with menus, 551activation groups, 31, 200-201
in using RPG and Java together, 758adapter classes, in user interface, 513ADD, 143Add Binding Directory Entry (ADDBNDDIRE),
84add method
for durations, in Java, 332-334JavaBeans and, 686in user interface in, 492
ADD, 118-119ADDDUR, 322, 323, 330-334, 335, 357
Note: boldface numbers indicate illustrations 767
addElement, vectors, 257, 262addition (+) operator, 118-119%ADDR, 185ALIGN, 194ALL, 106, 289ALLOC, 11, 51, 54, 185, 265, 362, 476allocating/deallocating memory, 11-12, 50-52,
53, 362new operator in, 53-55pointers, 185RPG IV, 50-52static initializers and, 644-645synchronized keyword and, 476-481variables, 201vectors and, 256, 264-271
AlphaBeans, 692alphaworks Web site, 692ALTER TABLE, 578alternating arrays, 255ALTSEQ, 192, 194AM_PM, 338anchor tags in HTML, 13AND, 126-128, 147and (&&) operator, 126-128anonymous inner classes, 642-644append method, StringBuffer class, 309-313applets, 1, 5, 6, 12-19, 19, 20, 660
download time of, and jar files, 90-91signing, 558Tip Calculation applet example for, 558-561, 561in user interface, 557-561
appletviewer, 7application programming interfaces (APIs)
call level interface (CLI) APIs in, 574-575,579
Java native interface (JNI) and, 646applications in Java, 19-20, 38, 557-561,
660-661, 661applyFormat method, 349args, 75, 94arithmetic expressions, 110-111arithmetic operators, 117-119arithmetic statements, 142Array class, 231ARRAY data type, 627
arraycopy, 242arrays, 75, 187, 226, 227, 228-255, 283
address of, 281alternating, 255Array class for, 231, 283arraycopy to copy, in, 242binarySearch in, 253, 254casting in, 242clone method to copy, in Java, 242comma separated elements in, 239compile time, 243, 279, 283compile time initialization of, 233-235constructors and, 246-248, 246creating or instantiating, 232-233CTDATA keyword for, 234-236data structures and, 229, 230declaring, 230-232DIM keyword for, 233, 234-235, 244-248dimensions in, 231, 232, 238%ELEM for length of, in RPG, 238Enumeration interface and, 403-409equals in, 253EVAL statement and, 236-237fill in, 253final, 235finalize method in, 246%FOUND and, 252FROMFILE keyword for, 236, 244-248garbage collector and, 246hashtables and, 229, 271-278helper methods for, 252-255index out of bound error in, 237, 430indexing of, 109, 137, 159-163, 232, 237initial values in, 235instantiation of, 283java.util and, 229length method for size of, in Java, 237LOOKUP and, 229, 252-255MOVEA and, 253multidimensional, 162, 229, 239-241, 283multiple, 232multiple occurring data structures (MODS)
and, 249new operator for, 232-233, 235, 242null values in, 246
768
INDEX A
object status of, in Java, 241-243objects in, arrays of objects, 249-242OCCUR in, 249-252parameter passing and, 278PERRCD keyword for, 236, 234-235, 244-248pre runtime, 229, 243-248Program Call Markup Language (PCML) in,
727references to, 241-243RPG vs. Java, 228-229runtime, 243, 283runtime initialization of, 236-238searches in, 252-255, 252size of, 231, 237, 238, 256, 283sort in, 253, 254SORTA in, 253square brackets in, 230-231, 237static, 235String literals in, 235tables and, 229TOFILE keyword for, 236, 244-248unbalanced, 248-249, 283vectors and, 229XFOOT for summing of, 255
Arrays class, 283ASCII vs. EBCDIC source files, 697asin, 140assignment expressions, 108assignment operator (=), 110, 119-120, 224assignment statement, 57, 110, 113, 117, 143,
161, 216asynchronous threads, 445-446, 446, 465-476, 465atan, 140atomic instructions, threads, 472@AUTHOR JavaDoc keyword, 102autoCommit, 620-621automatic fields, 201AWT, 20
Bbackslash character in Java directories, 665base classes, 363, 678base pointer data type, 206BASED, 50, 51, 53, 185, 192, 194, 271basing pointer data type, 182, 184, 185, 189
batch updates in database, 630BeanInfo class for JavaBeans, 688-690before and after, date compare, in Java, 334-335BigDecimal, 188, 189, 212, 218, 223, 78, 417BIGINT data type, 618binary data type, 183, 188, 207, 223, 618BINARY data type, 618binary large object (BLOB), 627binary operators, 108, 117, 121binary search, interfaces, 399-401binarySearch in arrays, 253Bind Service Program (BNDSRVPGM), 31, 83bindable APIs, exception handling, 425binder language, 83binding, 33, 202binding directories, 84binding in SQLJ, 633BIT data type, 618BITON/BITOFF, 129bitwise and (&), 130-132bitwise exclusive or (^), 130-132bitwise negation (-), 130-132bitwise operators, 126-132bitwise or (|), 130-132BLANK, 106BLANKS in strings, 289BLOCK, 568block statement, 109, 111-113blocks, 46, 97, 200boolean, 46Boolean class, wrappers and to/from, 220-221boolean data type, 187, 188, 189, 206, 214-215,
223BOOLEAN data type, 631boolean expressions, 109, 128, 149, 154, 167,
168boolean variables, 149BorderLayout manager, 520, 521-523, 523borders, 498-500, 499bound properties in JavaBeans, 678, 680-683BoxLayout manager, 521, 529-531, 530, 531braces, 45, 46, 96, 109, 111-113, 148-149, 151,
167, 200brackets, 48, 97, 230-231, 237
Note: boldface numbers indicate illustrations 769
A - B INDEX
break statement, in Java, 109, 114, 115, 144,145, 152-154, 171-174, 179
built-in functions in RPG, 39business objects, 416, 419button component methods, 502button state methods, in user interface, 507Byte class, wrappers and to/from, 220-221byte data type, 46, 187, 188, 189, 207, 217, 223bytecode, 10-11, 10, 32, 33, 93
CC language, 2, 11, 29C specs, 30, 35, 39, 42, 43, 71, 107, 190, 191CALL, 31, 35-36, 37, 71-72, 625-627
threads and, 445-446in user interface, 488
call backs, 186, 187interfaces and, 400-401
call level interface (CLI) APIs, database access,574-575, 579
Callable Statement, 583, 625-627, 630CALLP, 31, 36, 43-44, 56, 58, 108, 164, 185,
445-446calls, 30, 33, 37-38, 93
calling another program from Java, 672-675calling RPG procedures as RPG native
methods from Java in, 754-761command line parameters in Java, 72command line parameters in RPG, 71-72CommandCall class in, 713-714encapsulation vs., 362exec method in, 673Java native interface (JNI) and, 645Java programs, main method for, 69-71javac compiler and, 675to method, 37-38, 57PDM options for, 675procedures in RPG and, 43-44program call classes in, 673Program Call Markup Language (PCML) in,
673ProgramCall class in, 714-722QCMDEXEC command analyzer and, 673RPG calling Java in, 746-757static vs. dynamic, 380
stored procedure, 625-627threads and, 445-446, 447threads and, asynchronous method calls and,
448-456writing to command line, in Java, 74-78writing to command line, in RPG, 72-74
cancel method, 615capacity of vectors, 257capacity methods, StringBuffer class, 313capacity of StringBuffer class, 310-311CardLayout manager, 521cascading menus, 547cascading style sheets (CSS), 21case conversion in strings, 303-304case sensitivity in HTML, 12-13case sensitivity in Java, 45, 48, 697-698
packages in Java and, 88variable names, 105-107
case statement, 152-154casting, 135, 224, 227, 361, 365, 371, 409-411
arrays and, 242assignment statement and, 216BigDecimal, 218data types, 214-222in date and time manipulation, 349-351hashtables and, 272interfaces and, 391-392MOVE and, 216-218return statement and, 220vectors and, 262-263
CAT, 288, 291, 292catalog, for stored procedures, 627catch, in exception handling, 427, 428, 429,
434-442category of data types in RPG, 182-183CCSID, 185, 290CDE/Motif look and feel GUI, 552-553, 553CDMY, 340CEEHDLR and CEEHDLU APIs in exception
handling, 425ceil, 140CHAIN, 567ChangeListeners, 511-514Char, 183char data type, 46, 206, 217, 223, 285
770
INDEX B - C
CHAR data type, 618%CHAR, 74, 291Character class, wrappers and to/from, 220-221character data type, 182, 183, 187, 188, 189,
206, 223, 618character expressions, 109character field length, 173character large object (CLOB), 627character varying data type, 184CHECK, in strings, 288, 291, 292, 305-308check method, 437checking for characters in strings, 305-308CHECKR, in strings, 288, 291, 305-308child (sub) classes, 329, 349, 360, 368, 374-379,
417, 517CL commands for Java and Java Transformer,
703-705class (static) methods, 66, 93class instance creation expressions, 108class libraries (see also packages), 7class loader, 90class variables, 65, 96, 225, 644classes, 10, 32, 33, 38, 38, 44-46, 44, 48-50,
53-61, 93, 183, 198, 412abstract, 360anatomy of, 108-109anonymous inner, 642-644base, 363child, 329, 349, 360, 368, 374-379, 417, 517clone method for, 402-403copying, using Cloneable interface, 402-403declaring, 45definition of, 108deprecated, 328design of, 415-416extending, 92, 197, 202, 301, 360, 363, 364,
366, 367, 387, 417final, 301, 360helper, 392, 405hierarchy in, 366, 366, 377, 377immutable, 214inner, 640-642JavaBeans, 678-692methods defined for, 49mutable, 308
parent, 329, 349, 360, 368, 374-379, 416, 655public, 45usage of, 414
classification of data types, 182-183CLASSPATH setting
database drivers in, 587-595iSeries IBM Toolbox for Java and, 711Java on System i and, 702-703, 704library lists vs., 89in using RPG and Java together, 757,
760-761clear in hashtables, 272client applications, 6clone method, 242, 257, 402-403, 411, 419Cloneable interface, 401-403, 419CLOSE, in database access, 567, 578close method, in Java file management, 671CMDY, 340COBOL, 2, 29code, 38code samples, 763codepage, 185, 187, 290collaborative efforts, 29collections, in databases, 576-577colors, in user interface, 497-498columns, in databases, 576-577command line
writing to, in Java, 74-78writing to, in RPG, 72-74
command line parameters, Java, 72command line parameters, RPG, 71-72CommandCall class, 713-714comments, 81, 86, 142
Java, 97-105JavaDoc, 99-105keywords in JavaDoc, 102nested or block, 98-99RPG, 97-98
commit, 620, 621COMMIT, 568, 569, 575, 578, 620commitment control, in JDBC, 620-621commitment control, in RPG, 569COMMON conference, 2common gateway interface (CGI), 17-18, 17
Note: boldface numbers indicate illustrations 771
C INDEX
Common Object Request Broker Architecture(CORBA), 467, 647, 651
communication trail classes, 709COMP, strings, 288Comparable interface, 254Comparator interface, 401, 416compareTo, strings, 318comparison, 113compile time array, 233-235, 243, 279, 283compile units, 199compiler directives, 109compilers and compiling, 6, 7, 28, 52, 93, 109, 675
bytecode and, 10-11, 10database access and, 573interfaces and, 388-389Java, 33RPG, 32-33SQLJ and, 636
Component class, 493compression, 90-91, 710computational expressions, 108, 109, 116, 117,
142concat method, 291, 293concatenation of strings, 135, 292-293, 309concatenation (+) operator, 73, 293concurrency, in threads, 472-474conditional (?:) operator, 134, 154-155, 227conditional expressions, 108, 113conditional statements, 125CONNECT in database access, 575connected jobs, in threads, 446-448connection context in SQLJ, 633Connection interface, 583, 633-634connection pools, for database access, 630-631const, 107CONST, 173, 193constants, 224, 627
defining, in Java, 198defining, in RPG, 193figurative, 106interfaces and, 401
constrained properties, 683constraints in database access, 624constructors, 78-82, 92, 93, 360, 416, 517
anonymous inner classes and, 643
arrays and, 246-248exception handling and, 428, 437, 440inheritance and, 360, 368new operator and, 79, 437static initializers as, 645super keyword and, 368this and, 79
Container classes, 493containers, in user interface, 491, 515-543, 552,
552containment, 414contains method, 257, 263, 265, 378containsKey, 273containsValue, 273context menus, 548continue, 109, 114, 144, 145, 173-174, 179contracted operators, 120contracts (see also interfaces), 398control boundary in exception handling, 423copy member, 83, 99, 389-409/COPY, 40-41, 83copyInto, 258copyValue Of, 318core language of Java, 3core packages, 661cos, 140Coulthard, Phil, 765-766Create Binding Directory (CRTBNDDIR), 84Create Bound RPG (CRTBNDRPG), 29Create Display File (CRTDSPF), 519Create Journal (CRTJRN), 569Create Journal Receiver (CRTJRNRCV), 569CREATE PROCEDURE, 627Create Program (CRTPGM), 28, 31, 33, 35, 83Create RPG Module (CRTRPGMOD), 28, 33Create Service Program, 33, 83CREATExxx, in databases, 578, 598CTDATA keyword, 234-236current date and time, 327-330currentTimeMillis, 323, 356cursor in database access, 572, 573, 599-603,
634customizers for JavaBeans, 678
772
INDEX C
DD spec, 39-42, 71, 191-192, 193-195daemon threads, 465, 480, 510Data Definition Language (DDL) of SQL, 577,
598Data Manipulation Language (DML) of SQL,
577data structures, 42
arrays and, 229, 230databases, 576-577defining, in Java, 198defining, in RPG, 193-195exception handling and(INFDS and PSDS),
424multiple occurring data structures (MODS)
and, 249OCCUR in, 249-252Program Call Markup Language (PCML) in,
725-727qualified, 195
data types, 181-223BigDecimal and, 212boolean, in Java, 214-215casting of, 215-222, 224data conversion classes iSeries Toolbox, 722database access and, 617-619decimal point numbers and, 209-214declaring, 189-198escape sequences for, 206float vs. packed, 209-214get method for, 617half adjust and, 211, 213, 219Java vs. RPG, 46, 47, 186-189, 754-756JDBC, 627-628literals and, 205-207numeric conversion in (see also casting),
214-222precision in, 212primitive, 223, 225, 257, 281-282ranges for numeric, 207-209reference, 223, 225rounding and, 211, 213RPG, 182-186in using RPG and Java together, mapping of,
754-756
scale in, 212set method for, 617wrappers for, in Java, 220-223, 224
database access (see also SQL; SQLJ), 567-638ALTER TABLE in, 578autoCommit in, 620-621batch updates in, 630call level interface (CLI) APIs in, 574-575,
579Callable Statement interface for, 583, 625-627,
630cancel method in, 615classpath settings for drivers in, 587-595CLOSE, 578closing everything after using, 617collections in, 576-577columns in, 576-577commit in, 620, 621COMMIT in, 569, 575, 578, 620commitment control, in JDBC, 620-621commitment control, in RPG, 569compiler and, 573CONNECT in, 575connecting drivers in, 585-595Connection interface for, 583connection pools in, 630-631constraints in, 624Create Journal (CRTJRN) in, 569Create Journal Receiver (CRTJRNRCV) in,
569CREATExxx in, 578, 598creating SQL statement objects for, 595-597cursor in, 572, 573, 599-603Data Definition Language (DDL) of SQL in,
577, 598Data Manipulation Language (DML) of SQL
in, 577data structures in, 576-577data types and, 617-619data types in, JDBC, 627-628database drivers/driver managers in, 580,
582-583, 637DatabaseMetaData in, 622-623, 622DatabaseMetaData interface for, 583dates and times in, 329-330, 602
Note: boldface numbers indicate illustrations 773
D INDEX
database access, continuedDECLARE CURSOR, 578, 603DELETE in, 571, 572, 578, 595, 598, 599,
603, 612direct record access in, 568disk files in, 576-577Driver interface for, 583DROPxxx in, 578End Commitment Control (ENDCMTCTL)
in, 569Enterprise JavaBeans and, 631%ERROR in, 568exceptions, SQLException in, 589, 596, 597,
616EXEC SQL and END-EXEC in, 572EXECUTE IMMEDIATE in, 573executeQuery in, 599extenders for opcodes, in RPG, 568EXTFILE, 568EXTMBR, 568F specs and, 567-568, 621FETCH for, in RPG, 571, 573, 578fields in, 576-577filtering, 570, 571get methods in, 619, 621, 628GROUP BY clause in, 570HAVING clause in, 571indexes in, 576-577INSERT, 572, 578, 596, 598, 599, 612INSERT INTO for, 572interactive vs. embedded SQL, 572-573interfaces for, 630-631interfaces of JDBC in, 583is method in, 621-622iSeries Toolbox for Java connection in, 590,
590isolation levels in, 620Java Database Connectivity (JDBC),
580-581, 581, 583-603Java Naming and Directory Services (JNDS)
for, 630-631Java Transaction Services (JTS) in, 630-631Java.sql in, 580, 583JDBC 3.0, 631JDBC native driver in, 581
JDBC net drivers in, 581JDBC thin drivers in, 581JDBC-ODBC bridge driver in, 581keywords for, in RPG IV, 568libraries in, 576-577local vs. distributed SQL in, 575-576LOCK TABLE, 612locks, 568logical files in, 576-577metadata in, 576-577, 631metadata in, JDBC, 621-624naming conventions in, 594-595null values in, 619-620OPEN, 578Open Database Connectivity (ODBC) and,
574, 575, 579, 580optimization in, 573, 574ORDER BY clause in, 570PDM user defined options in, 606-614physical files in, 576-577positioned update and delete in, 572, 603predicate or WHERE clause in, 570PreparedStatement class in, 583, 596, 617,
630properties for database drivers in, 591-595queries in, 571, 599queries, examples of, 603-605reading a few rows at a time in, 614-615record level, using iSeries Toolbox, 736-744records in, 576-577referential integrity in, 624registering drivers in, 585-595requirements for using SQL on System i, 579result sets in, 571, 599-603ResultSet in, 583, 628-629ResultSetMetadata in, 583, 621-622Roll Back (ROLBK) in, 569rollback in, Java, 620, 621ROLLBACK in, RPG, 575, 578rows, columns, and tables in, 570, 576-577RPG cycle in, 568RPG IV, 567-568Run SQL (RUNSQLCMD) in, 572running SQL statements for, 597-599savepoints in, 631
774
INDEX D
schema in, 576-577SELECT in, 570-572, 578, 595, 596, 599,
602, 603, 612SET, 596set methods in, 597-599, 620, 626, 628setMaxRows method in, 615setMaxTimeout method in, 615SQL (Structured Query Language) in, 568,
569-572SQL embedded in Java (SQLJ) for, 631-636SQLWarning class in, 616Start Commitment Control (STRCMTCTL)
in, 569Start Journal Physical File (STRJRNPF) in,
569Start SQL (STRSQL) in, 572Statement class in, 583, 596, 630static vs. dynamic SQL in, 573-574%STATUS in, 568stored procedures in, 624, 625-627tables in, 576-577terminology used in, RPG vs. SQL, 576-577threads and, 614-615triggers in, 624truncation warnings in, 616try/catch in, 596UPDATE in, 571, 572, 578, 595, 596, 598,
599, 603, 612value extraction in, using get methods,
600-603VALUES clause, 596views in, 576-577VIsualAge RPG and, 575warnings in, handling, 615-624WebSphere Application Server and, 631WHERE clause, 570writing JDBC code, steps in, 584
database drivers/driver managers, 580classpath settings for, 587-595connecting, 585-595database access and, 582-583properties for, 591-595registering, 585-595
database plans in SQLJ, 632DatabaseMetaData, 583, 622-623
DATALINK data type, 631DataQueue class, 727-736,DATE, 322, 323, 333, 337Date class, 327-330, 331, 357, 602date data type, 182, 184, 185, 189, 206, 618DATE data type, 618dates and times, 321-357
add method for durations, in Java, 332-334ADDDUR, 322, 323, 330-335, 357AM_PM, 338applyFormat method in, 349before and after methods to compare dates, in
Java, 334-335casting in, 349-351, 349CDMY, 340CMDY, 340comparing dates in, 334-335current, 327-330currentTimeMillis method in, 323, 356database storage of, 329-330, 602DATE in, 322, 323, 333, 337Date class in, 327-330, 331, 357DATFMT in, 323, 338, 340, 357DAY in, 322DAY_OF_MONTH in, 337DAY_OF_WEEK in, 337DAY_OF_WEEK_IN_MONTH in, 337DAY_OF_YEAR in, 337DAYS in, 331, 333default formatter for, 349-351DMY format for, 322, 339, 344DST_OFFSET in, 338duration calculation in, 322, 330-334ElapsedTime class example for, 325, 334epoch of computer time in, 324, 356equals to compare dates, in Java, 334-335ERA, 337%ERROR for, 352EUR, 339, 344, 345, 348extracting parts of date or time in, 335-338, 357EXTRCT in, 322, 323, 335-338, 357formats for, 322, 338-348get method for, in Java, 336-337, 338getDateInstance in, 349, 357getDateTimeInstance in, 349, 357
Note: boldface numbers indicate illustrations 775
D INDEX
dates and times, continuedgetTime in, 328, 329getTimeInstance in, 349, 357GregorianCalendar class in, 323, 328, 329,
330, 331, 337, 357HMS, 345, 348HOUR in, 333, 338HOUR_OF_DAY in, 338HOURS in, 331, 333IF to compare dates in, RPG, 334-335isLeapYear in, 354, 357ISO, 338, 339, 344, 345, 348Java support for, 322-323JIS, 339, 344, 345, 348JUL, 339, 344leap year calculations in, 354, 357locales for internationalization in, 562-563LONGJUL, 340MDY, 339, 344MILLISECOND in, 333, 338MINUTE in, 333, 338MINUTES in, 331, 333MONTH in, 322, 333MONTHS in, 331, 333MSECONDS in, 331, 333parse method to test dates/times, in Java,
352-353quotes in, 343raw time and clocks in, 323-327rolling behavior of Java in, 333RPG IV and enhancements to, 322SECOND in, 333, 338SECONDS in, 331, 333separators in, 339, 343, 344set method in, 338SimpleDateformat class for, 323, 340-344,
346, 349, 357SimpleTimeZone, 355-357special Java characters for date formatting in,
342-344special Java characters for time formatting in,
347SUBDUR in, 322, 323, 330-334, 335, 336,
357System class and, 324
TEST in, 322, 323, 351-354testing dates and times in, 351-354TIME in, 321-323, 327-330time zones in, 348, 355-356TimeZone class for, 323, 355-356, 357TIMFMT in, 323, 344-346, 357UDATE in, 321UDAY in, 321, 322MONTH in, 321, 322USA, 322, 339, 344, 345, 348, 352UYEAR in, 321WEEK_OF_YEAR in, 337YEAR in, 322, 333, 337YEARS in, 331, 333YMD in, 339, 344ZONE_OFFSET in, 338
DATFMT, 323, 338, 340, 357DAY, 322DAY_OF_MONTH, 337DAY_OF_WEEK, 337DAY_OF_WEEK_IN_MONTH, 337DAY_OF_YEAR, 337DAYS, 331, 333DB2 Query Manager and SQL Development Kit
for OS/400 (5716-ST1), 579DBCS characters, 185deadlock, 480-481, 480, 486DEALLOC, 11, 265debuggers, 8, 73
Java on System i and, 705printStackTrace in, 428-429
DECIMAL data type, 618decimal point numbers, float vs. packed,
209-214decision statements, 109decision structures, 144, 146-171DECLARE CURSOR, 578, 603decrement (- -) operator, 121-124default package, 86default threads, 465DEFINE, RPG, 190-195DELETE, SQL, in databases, 567, 571, 572,
578, 595, 598-599, 603, 612delete, file management in Java, 668DeMorgan’s rule, 128
776
INDEX D
deprecated classes, 328@DEPRECATED JavaDoc keyword, 102design tips for OO programming, 415-418determinant loops, 156-163Developer Kit for Java (JDK), 695dialog boxes
message and simple input, 556-557, 556, 557predefined, 553-555
DIM keyword, in arrays, 233, 234-235, 244-248direct execution (DE) objects, Java on System i,
704direct record access in database access, 568directories, for Java packages, 89directories list in Java, 667-669directory creation in Java, 669-670disconnected vs. connected jobs, 446-448disk files, in databases, 576-577display files, in user interface, 487-488, 490, 519DISTINCT data type, 627Distributed Computing Environment (DCE), 647distributed object, remote method invocation
(RMI) in Java, 647distributed SQL, 575-576DIV, 118-119division (/) operator, 118-119DMY, 322, 339, 344do, in Java, 145, 171DO, in RPG, 144, 145, 155-163, 179do until, Java, 165-169, 170-171do while, Java, 144, 155-156document object model (DOM), 21DocumentListener, 511-514domain names, 15Domino, 1dot operator, 57, 93DOU, in RPG, 108, 144, 145, 164, 155-156,
170-171, 179Double class, wrappers and to/from, 220-221double data type, 46, 78, 187, 188, 189, 207,
223, 618DOUBLE data type, 618DOW, in RPG, 108, 116, 121, 144, 145,
155-156, 164, 165-169, 179drive listing in Java, 669Driver interface, 583
drivers for database connection, 633, 637DROPxxx in database access, 578DSPLY, 73DST_OFFSET, 338DTAARA, 194duration calculations, in date and time
manipulation, 322dynamic link libraries (DLL), 31dynamic HTML (DHTML), 21dynamic loading, 33dynamic SQL, 573-574
EE spec, 190EBCDIC, 187, 223, 697eBusiness, 2, 3Eclipse, 2, 8, 9, 43, 701, 744ElapsedTime class example, 325/%ELEM for length of arrays, in RPG, 238elementAt, 258elements method, 258, 272else, in Java, 113, 146-151, 179ELSE, in RPG, 146-151ELSEIF, RPG, 150embedded SQL, 572-573, 746empty block, 113, 115empty statements, 109, 113encapsulation, 68-69, 261, 361-362, 412, 490End Commitment Control (ENDCMTCTL), 569ENDDO, 116, 121, 145, 156, 166ENDIF, 145, 147ENDMON, 425ENDSL, 153endsWith, 318ensureCapacity, 258, 313Enterprise Edition JSDK (J2EE), 692Enterprise JavaBeans, 1, 6, 9, 22-23, 631, 692, 696ENTMOD, 35entry points, for threads, 483Enumeration interface, 401, 403-409, 419%EOF, 425epoch of computer time, 324, 356EQ, 125, 147equal (= =) operator, 125, 227, 287%EQUAL, 425
Note: boldface numbers indicate illustrations 777
D - E INDEX
equals method, 378, 416arrays and, 253date compare, in Java, 334-335hashtables and, 274, 275, 283overriding, 411strings and, 318vectors and, 263, 265
equalsIgnoreCase, 318ERA, 337Error class, 427, 429, 430, 433, 443, 460, 471%ERROR
database access and, 568in date and time manipulation, 352exception handling and, 425
ESCAPE, 422escape characters, 665escape messages, SQLJ, 434escape sequences, 206, 290EUR, 339, 344, 345, 348eval, 119EVAL, 36, 39-40, 43, 58, 108, 116-122, 138,
143, 164arrays and, 236-237, 288, 298strings and, 293
EVALR, 108, 288-291events
anonymous inner classes and, 643JavaBeans and, 678, 683-687, 687listeners for, 511-514multicast, 687unicast, 687in user interface, 492, 509-514
EVLR, 164Exception class, 443
exception handling and, 427, 430, 433, 441threads and, 460
exceptions, 421-443bindable APIs in, 425CEEHDLR and CEEHDLU APIs in, 425classes to use in, searching Java
documentation, 431-433constructors and, 428, 437, 440control boundary in, 423data structures (INFDS and PSDS) in, 424
database access and, SQLException in, 589,596-597, 616
ENDMON in, 425%EOF for, 425%EQUAL for, 425Error class for, 427, 429, 430, 433, 443%ERROR for, 425ESCAPE in, 422escape messages and, 434Exception class for, 427, 430, 433, 441, 443exception objects in Java, 428-431file errors in, 423finally block in, 442, 443%FOUND for, 425getMessage for, 427, 428-429, 430, 433, 443GOTO and ENDSR in, 425handlers for, 423index out of bounds error in, 430indicators of, in RPG III, 424INFSR subroutine for, 424integrated language environment (ILE)
model, 423Java, 426-443JavaBeans and, 683Monitor Message (MONMSG) in, 422, 434,
441, 443MONITOR operation for, 425-426multiple, using catch statement for, 441-442NOTIFY in, 422ON ERROR group in, 425%OPEN for, 425Original Programming Model (OPM) model,
422-423printStackTrace in, 428-429, 443procedures and, 424, 425program errors in, 423PSSR subroutine for, 424RPG III and, 423-424RPG IV, 424-425in using RPG and Java together, 761RuntimeException class for, 429RunTimeException in, 430Send Program Message (SNDPGMMSG) in,
422, 433, 443serialization and, 654
778
INDEX E
severity of, 429signature of methods in, 435SQLJ and, 634static initializers and, 645STATUS in, 422%STATUS for, 425System i overview of, 421-426threads and, 460, 464, 471throw operator for, 427, 433-437, 441, 443Throwable class for, 427, 428-431, 433, 441throws clause for, 427, 428, 435, 443try/catch block for, 427, 428, 429, 434-442, 443unique IDs for, 429verify method in, 437
exclusive or (^) operator, 126-128exec method, for calls, 673EXEC SQL and END-EXEC, 572executables (exe), 31
calling another program from Java, 672-675EXECUTE IMMEDIATE, 573executeQuery, 599EXFMT, 487exists method, in Java file management, 668EXIT, 175exit points, 177exp, 140exponentiation (**) operator, 119, 137, 142EXPORT, RPG, 92, 192, 194, 199
service programs and, 82-84variables, 201-202
export command, Java on System i, 702exporting, 34expression statement, 108, 110-111expressions, 57, 107, 108, 116-137, 142, 147
assignment, 108boolean, 109, 128, 149, 154, 167, 168character, 109class instance creation, 108computational, 108, 109, 116, 117, 142conditional, 108, 113fetch, 109, 116, 123, 136-137, 142index array, 137method call, 108, 109, 137null, 109, 136-137numeric, 109
parentheses in, 127pre/post increment/decrement expression, 108
EXSR, 56, 445-446extcheck, 8extenders for opcodes, in RPG, 568extending a class, 92, 197, 202, 301, 360, 363,
364, 366, 367, 387-409, 417extends keyword, 367extends Thread, 451-454extensions for files in Java, 677external access to variables, 201-202EXTFILE, 568EXTIND, 568EXTMBR, 568extracting, 357EXTRCT, 322, 323, 335-338, 357
FF specs, 39, 42
database access and, 567-568, 621in user interface, 487-488
factory design pattern, 382-387, 419, 489Farr, George, 765-766FEOD, 567FETCH, in database access, 571, 578fetch expressions, 109, 116, 123, 136-137, 142field description classes, AS/400 Toolbox for
Java, 731-732field reference files (FRF), 372, 382fields (see variables), 35fields, in databases, 576-577figurative constants, 106file errors, exception handling, 423file listing in Java, 667-669file management in Java, 664-669
backslash character in, 665close method in, 671delete in, 668directory creation in, 669-670drive listing in, 669exists in, 668extensions for files, 677flat files in, create, open, write to, 670-671flat files in, reading, 671-672flush method in, 671
Note: boldface numbers indicate illustrations 779
E - F INDEX
file management in Java, continuedfully qualified names in, 669getAbsolutePath in, 669getName in, 669getParent in, 669isDirectory in, 668Java on AS/400 and, 697-698list method in, 668listing files and directories in, 667-669mkdir in, 668, 669-670naming files, 677readLine method in, 672stream files in, 668, 670system properties for, 665-667working directory in, changing, 665-667working directory in, finding, 664-665
file system, Java packages, 88file transfer protocol (FTP), Java on System i,
701, 702fill method, 253filtering, 570, 571final
arrays and, 235classes, 301, 360inheritance and, 379, 380inner classes and, 641methods, 360variables, 197, 198, 223, 224
finalizearrays and, 246overriding, 411
finally, 442-443, 464firewalls, 16first in first out (FIFO), 727, 728firstElement, 258flat files in Java, create, open, write to, 670-671flat files in Java, reading, 671-672Float class, wrappers and to/from, 220-221float data type, 46, 78, 124, 183, 184, 187, 188,
189, 207, 209-214, 223, 618FLOAT data type, 618%FLOAT, 219floor, 140flow of control, 36, 93, 109, 125, 143, 144,
171-178
boolean data types and, 214-215Java, 37-38RPG, 35-36
FlowLayout manager, 520, 523-524, 524flush method, in Java file management, 671focus, in user interface, 513FocusListener, 511-514fonts, 498for, in Java, 113, 115, 144, 145, 155-163, 169,
171, 179, 215FOR, in RPG, 108, 164-165, 164form panels, in user interface, 536-543, 540, 541formats for dates and times, 322, 338-348forms, for Web pages, 17%FOUND
arrays and, 252exception handling and, 425
FREE and ENDFREE compiler directives, 40,54
free-format calculation, 40freely distributable math library (FDLIBM), 137FROMFILE keyword, 236, 244-248fully qualified names in Java file management,
669functions in RPG, 39
Ggarbage collection, 11-12, 54, 136, 214, 246, 465GE, 125, 147get and getter methods
for data types, 617database access and, 600-603, 619, 621, 628in date and time manipulation, 336-337, 338hashtables and, 272introspection in JavaBeans and, 687JavaBeans and, 678, 680, 681, 688user profiles and, 675-677
getAbsolutePath, 669getBytes, 318getChars, 318getDateInstance, 349, 357getDateTimeInstance, 349, 357getKey, 275getMessage, 427, 428-429, 430, 433, 443getName, 669
780
INDEX F - G
getParent, 669getter (see get and getter methods)getTime, 328, 329getTimeInstance, 349, 357global variables, 38, 59, 199-200, 223, 466goto, in Java, 107, 172GOTO, in RPG, 144, 145, 175, 179, 425graphic data type, 182, 184, 185, 206GRAPHIC data type, 619graphic varying data type, 184graphical user interface (GUI) (see user
interface design and Swing)greater than (>) operator, 125greater than or equal (>=) operator, 125GregorianCalendar class, 323, 328, 329, 330,
331, 337, 357,GridBagLayout manager, 521, 525-528, 525,
527, 528GridLayout manager, 520, 524-525, 525GROUP BY clause, 570GT, 125, 147GUI Builder, 710
HH spec, 35, 36, 39half adjust, 211, 213, 219handlers, exception, 423has a relationship, 415hashCode, 411hashcode method, 416Hashtable class, 378, 675-677hashtables, 271-278, 283
arrays and, 229casting in, 272clear in, 272containsKey in, 273containsValue in, 273elements in, 272equals and, 283equals in, 274, 275get method in, 272getKey in, 275isEmpty in, 272key value pairs and, 271-278keys method in, 272
LOOKUP and, 271next in, 272null values and, 272remove in, 273searches in, 275size in, 273
hasMoreElements, 404HAVING clause, 571hello world
Java, 75RPG, 73
helper classesinterfaces and, 392, 405iSeries Toolbox for Java and, 708-709
helper methods, 68, 252-255HIVAL, 106HMS, 345, 348HotJava Web browser, 5HOUR, 333, 338HOUR_OF_DAY, 338HOURS, 331, 333HTML classes, 709hypertext markup language (HTML), 5, 2, 7,
12-22hypertext transfer protocol (HTTP), 5, 15-16,
18, 22, 655
II specs, 39, 190IBM Distributed Debugger, 705idltoJava, 8if, in Java, 111, 112, 113, 115, 125, 126, 134,
144, 145, 146-151, 179IF, in RPG, 58, 108, 145, 146-161, 164, 175
date compare, in RPG, 334-335strings and compare, 288
IGNORE/INCLUDE, 488, 568images in user interface components, 505-508, 507immutable classes, 214implement Runnable, 455-456implementing an interface, 361, 390-391import packages in Java, 86IMPORT, 192, 194, 199, 201-202import statement, 86, 94, 109INCLUDE, 568
Note: boldface numbers indicate illustrations 781
G - I INDEX
include files, 11, 99increment (++) operator, 121-124increment/decrement, 108, 111, 121-24indentation of code, Java, 96index array expressions, 137index out of bounds error, 237, 430indexed properties, JavaBeans, 679indexes, in databases, 576-577indexing arrays, 109, 137, 159-163, 232, 237indexing vectors, 266indexOf
strings and, 291, 295-298vectors and, 258
indicator data type, 184, 189, 206, 214, 215indicators, in user interface, 490inequality ( and ! =) operators, 128INFDS, 424, 568infinite loops, 160, 165, 369INFSR, 145, 424, 568inheritance, 361, 379-382, 414, 417
abstract and, 379, 380-382constructors and, 360, 368enforcing, 380-382field reference files (FRF) and, 382final and, 379, 380inlining and, 380interfaces vs., 398-399, 400-401multiple, 11, 451overriding methods in, 379preventing, 379-380in user interface components, 496-500in user interface, Swing classes and, 489
initializers, static, 644-645initializing variables, INZ keyword, 51, 191,
192, 193, 224inlining, 380inner classes, 640-642
anonymous, 642-644INSERT, 572, 578, 596, 598, 599, 612INSERT INTO, 572insertElementAt, 258instance of a class, this variable, 59-61instance variables, 55, 68, 93, 96, 167, 198, 201,
204, 418threads and, 447, 447, 457, 466, 471, 477
instanceOf operator, 135, 227, 410-411instantiating an object, new operator, 54int data type, 46, 187, 188, 189, 207, 223, 618/%INT, 219integrated development environment (EDE), 2INTEER data type, 618Integer class, wrappers and to/from, 220-221integer data type, 183, 184, 188, 189, 207integrated development environment (IDE), 8Integrated File System (IFS), 33
Java on iSeries and, 695, 697-700integrated language environment (ILE), 27, 29, 423interactive vs. embedded SQL, 572-573interface keyword, 389interfaces, 187, 226, 360, 387-409, 419
abstract, 389call backs as, 400-401casting and, 391-392Cloneable, 401, 402-403Comparator, 401compilers and, 388-389constants and, 401contracts as, 398copy members and, 389-409database access and for, 630-631Enumeration, 401, 403-409extending classes and, 387-409graphical user interface (GUI), 402helper classes and, 392, 405implementing, 361, 390-391, 398-399,
400-401interface keyword in, 389introspection in, 389Iterator, 407Java Database Connectivity (JDBC), 402,
583Java-supplied examples of, 401-409object reference variables and, 391pointers and, 400-401polymorphism and, 399procedure pointers vs., 400-401prototyping vs., 387-409public, 389reuse of code, 394-399Runnable, 401
782
INDEX I
search in, 399-401service programs vs. ., 387-409, 400-401signatures and, 389, 404sort method and, 399-401threads and, 454-456, 461, 462, 463, 485in user interface, Swing classes and, 489
international characters, 304internationalization of user interface, resource
bundles, 562-566Internet, 5, 12-19Internet Information Server (IIS), 18Internet Inter Orb protocol (IIOP), 651Internet service providers (ISPs), 14-15interpreters, 6, 7%INTH, 219introspection, 389, 688INZ, 51, 191, 192, 193, 194, 195, 224, 288, 289is a relationship, 415, 417is method, 223, 621-622isAlive, 482-483, 486isDigit, 437isDirectory, 668isEmpty, 258, 272iSeries (see System i)iSeries Developer Kit for Java (JDK), 695,
697-705iSeries Toolbox for Java, 5, 558, 696, 705-744
classpath setting for, 711CommandCall class in, 713-714compressed files in, 710data conversion classes in, 722database access and, 590, 590field description classes in, 731-732functions in, 706-708GUI Builder in, 711help in, 744helper classes in, 708-709JarMaker and, 744JTOpen for, 711obtaining and installing, 710-711Panel Definition Markup Language (PDML)
in, 710Program Call Markup Language (PCML) in,
710, 723-727ProgramCall class in, 714-722
record level database access and, 736-744Secure Socket Layer (SSL) connection to,
712TCP/IP and, 711user interface and, 710visual classes in, 709
isLeapYear, 354, 357ISO, 338, 339, 344, 345, 348isolation levels, 620ITER, 144, 145, 172-174, 179Iterator interface, 407iterators, SQLJ, 634, 635
JJ2EE, 692jar files, 7, 90-91, 697
JarMaker and, 744JarMaker, 744jarsigner, 8java command, 7, 37, 650, 697JAVA command, 37, 746Java Database Connectivity (JDBC) (see also
database access), 402, 558, 580-581, 581,583-603
Java development kit (JDK), 7-10, 8Java Naming and Directory Services (JNDS),
630-631Java native interface (JNI), 645-646
calling another program from Java, 672-675in using RPG and Java together, 745
Java on System i, 1-25, 695-744, 695case sensitivity of Java and, 697-698CL commands for Java and Java Transformer
in, 703-705classpath settings in, 702-703, 704CODE/400 and, 701copying Java files to OS/400, 701debugging and, 705direct execution (DE) objects and, 704Enterprise JavaBeans and, 696file management and, 697-698file transfer protocol (FTP) to copy files in,
701, 702help in, 744IBM Distributed Debugger for, 705
Note: boldface numbers indicate illustrations 783
I - J INDEX
Java on System i, continuedinstalling components for, 696Integrated File System (IFS) and, 695,
697-700iSeries Developer Kit for Java (JDK), 695,
697-705iSeries Toolbox for Java and, 696, 705-744
classpath setting for, 711CommandCall class in, 713-714compressed files in, 710data conversion classes in, 722field description classes in, 731-732functions in, 706-708GUI Builder in, 710help in, 744helper classes in, 708-709JarMaker and, 744JTOpen for, 711obtaining and installing, 710-711Panel Definition Markup Language
(PDML) in, 710Program Call Markup Language (PCML)
in, 710, 723-727ProgramCall class in, 714-722record level database access and, 736-744Secure Socket Layer (SSL) connection to,
712TCP/IP and, 711user interface and, 710using classes in, 711-712visual classes in, 709
JavaServer Pages and, 696mapped drives for, 705OS/400 and 700-702QShell Interpreter and, 695, 697-700,
702-703RUNJVA and, 703servlets and, 696UNIX programmers and, 697-700VIsualAge for Java and, 700, 701, 705
Java plug ins for browsers, 561Java remote method invocation (RMI), 647-651
client side code, 648-651registry in, 649-651server side code, 648-651
Java Runtime Environment (JRE), 10-11Java source code, 33, 93Java Transaction Services (JTS), 630-631Java Transformer, 703-705Java Virtual Machine (JVM), 660
in using RPG and Java together, 745,756-757
threads and, 447, 464java.awt, 381, 402, 488, 493, 662java.beans, 662, 680-683java.io, 554, 670java.lang, 87, 138, 186, 419, 661, 662
Cloneable interface in, 402-403exception handling and, classes for, 431-433Runnable interface in, 455Runtime class in, 672String class and, 285Throwable class in, 428-431
java.math, 661, 662java.net, 663java.nio, 663java.rmi, 663java.security, 663java.sql, 583, 661java.sql, 580java.text, 340-344, 661java.util, 661, 663
Array class, 283arrays and, 229Date class in, 602interfaces and, 401Locale object in, 563Properties class in, 675TimeZone class in, 355Vector class in, 256
JAVA_OBJECT data type, 627JavaBeans, 2, 678-692
add/remove methods in, 686base classes and, 678BeanInfo class for, 692-694bound properties in, 678, 680-683constrained properties in, 683creation of, 690customizers for, 678events in, 678, 683-687, 687
784
INDEX J
exceptions and, 683get methods for, 678, 680, 681, 688indexed properties in, 679introspection in, 688Java.beans package in, 680-683listeners and, 681-685, 687, 688methods in, 678multicast events in, 687properties of, 678-680property editors for, 678serialization in, 687-688set methods for, 678, 680, 681, 688SmartGuides for, 691, 691sources for, 692synchronized keyword and, 686this in, 681tools for, 690-691unicast events in, 687Visual Composition Editor (VCE) and, 690VisualAge for Java and, 690, 690, 691
javac, 7, 33, 85, 93, 675, 697javadoc, 7, 100, 142, 697JavaDoc comments, 99-105javah, 7javap, 8, 697JavaScript, 2, 20-21JavaServer Pagers, 1, 2, 9, 21-22, 489, 692, 696javax, 661javax.accessibility, 662javax.crypto, 662javax.imagio, 662javax.naming, 662javax.print, 663javax.sound, 663javax.sql, 630javax.swing, 381, 402, 488, 493, 663javax.transaction, 663javax.xml, 664JBroker, 20JBuilder, 8JButton, 381, 491, 494, 496, 502, 506, 509, 514,
550, 683JCheckBox, 381, 491, 494, 496, 502, 506, 509JCheckButton, 514JColorChooser dialog, 553-555, 555
JComboBox, 494, 496, 503, 509, 514JComponent, 381, 493jdb, 7JDBC native driver, 581JDBC net drivers, 581JDBC thin drivers, 581JDBC-ODBC bridge driver, 581JDesktopPane, 551JDialog, 491, 515-543, 519JFileChooser dialog, 553-555JFrame, 491, 515-543JInternalFrame, 551JIS, 339, 344, 345, 348JLabel, 494, 493, 496, 506, 509, 543JList, 494, 503, 509, 508, 508, 514jobs vs. threads, 446-448join method in threads, 482, 484, 486JOptionPane class, 556-557, 556, 557JPanel, 491, 515-543 531JPasswordField, 494, 496, 502, 509, 514, 543JProgressBar, 551JRadioButton, 494, 496, 502, 506, 509, 514JScrollPanel, 494, 496JSlider, 551JSplitPane, 552JTabbedPane, 521, 552JTable, 551, 613, 613JTextArea, 494, 496, 502, 509, 514JTextComponent class, 502JTextField, 494, 496, 502, 509, 514, 543-545JTextPane, 551, 552JToolBar class, 550-551JTOpen, 711JTree, 551JUL, 339, 344
Kkey/value pairs, hashtables, 271-278KeyListener, 511-514keys method, 272keytool, 8keywords, 41, 42, 51, 102, 106-107
Note: boldface numbers indicate illustrations 785
J - K INDEX
Llabeled statements, 109, 114-115labels, Java, 114last in first out (LIFO), 727, 728lastElement, 258lastIndexOf, 258, 297-298layout managers, 492, 519-531LE, 125, 147leap year calculations, 354, 357LEAVE, RPG, 144, 145, 165, 171-174, 179LEAVSR, 177-178left shift (<), 130-132%LEN, 51, 291, 299-300length method, 173, 237, 291, 300less than (<) operator, 125less than or equal (<=) operator, 125libraries, in databases, 576-577library lists, 28, 89lifetime of variables, 200-201LIKE keyword, in RPG, 191LIKEDS, 195line breaks, Java, 95@LINK JavaDoc keyword, 102linked list program and vectors, 267Linux, 9, 705list component methods, 503list method in Java file management, 668listeners
anonymous inner classes and, 643JavaBeans and, 681-685, 687, 688in user interface, 511-514
listing files and directories in Java, 667-669lists and vectors, 265ListSelectionListener, 511-514literals, 205-207
String, 235, 289local variables, 205local fields, 34local variables, 36, 55, 60, 63-64, 199-201, 223
threads and, 447, 447, 457, 466, 471, 477local vs. distributed SQL, 575-576locales for internationalization, 562-563LOCK, 567LOCK TABLE, 612locking, in threads, 476-478, 477, 479, 476
locks, database access, 568, 612logarithms, 137logical files, 416, 576-577logical operators, 126-128, 147long, 46Long class, wrappers and to/from, 220-221long data type, 187, 188, 189, 207, 223LONGJUL, 340LONGVARBINARY data type, 618LONGVARCHAR data type, 618LONGVARGRAPHIC data type, 619look and feel settings for in user interface,
552-553, 555LOOKUP
arrays and, 229, 252-255, 252hashtables and, 271, 271-278
loop statements, 109loops, 112, 114, 121, 125, 144, 155-156, 179
determinant, 156-163infinite, 160, 165, 369LEAVE, 165nested, 171, 175
LOVAL, 106LT, 125, 147
Mmain procedures/method, 70, 93, 94, 558
Java, 69-71threads and, 464, 469, 483, 486
mainline code, 36, 43maintenance of code, 29make files, 11mapped drives for Java on System i, 701marshalling, in remote method invocation (RMI)
in Java, 647Math class in Java, 137-142mathematical functions, 142max, 140Max, 141MAX_VALUE, 223MDY, 339, 344memory management (see
allocation/deallocation of memory)menu bars and popups, 545-550, 546menus
786
INDEX L - M
actions associated with menus in, 551shortcuts for menu items in, 550
Message Queue Series (MQ Series), 727metadata, in databases, 576-577, 621-624, 631Metal look and feel GUI, 552-553method call expressions, 108, 109, 137methodologies for OO programming, 413methods in Java, 37, 38, 47-48, 68, 93, 108, 198,
360, 412abstract, 360, 418accessing, 55-58calling RPG procedures as RPG native
methods from Java in, 757-761calls to, 37-38, 57class (static), 66, 93constructors, 78-82defining of, for class, 49design of, 418factory method design patterns in, 382-387final, 360inlining, 380JavaBeans and, 678naming, 47-48overloading, 61, 67, 78-82, 93, 370, 377overriding, 360, 361, 368, 378, 379, 381, 411private, 364, 368, 378protected, 360, 364, 368public, 364, 378same-named, 61side effects of, 111signature of, 70, 93, 368, 389, 404, 435, 451,
455static, 65-69, 418super keyword and, 360threads and, asynchronous calls to, 448-456in user interface components and, 496-508
MILLISECOND, 333, 338min, 140, 141MIN_VALUE, 223MINUTE, 333, 338MINUTES, 331, 333mkdir, in Java file management, 668, 669-670Mnemonics class, 505mnemonics in user interface, 504-505, 504, 505,
518
modal behavior, in user interface, 518model view controller (MVC), 508-509modifiers in Java (see also public; private;
protected), 45, 91-92, 360, 364native, 645-646, 645synchronized, 473-475, 476-481transient, 655variables and, 197, 223
MODULE, 38modules in RPG, 28-30, 29, 34-35, 34modulus or remainder (percent) operator,
118-119monetary values, data types, 210-214Monitor Message (MONMSG), 434, 422, 441,
443MONITOR operation, exception handling and,
425-426MONTH, 322, 333MONTHS, 331, 333Motif look and feel GUI, 552-553, 553MouseListener, 511-514MouseMotionListeners, 511-514MOVE, 120, 143, 147, 216-218, 288MOVEA, 253, 288MOVEL, 288MSECONDS, 331, 333MULT, 118-119multicast events, 687multidimensional arrays, 162, 229, 238-241, 283multiple arrays, 232multiple inheritance, 11, 451multipl occurrencece data structures (MODS),
249, 727multiplication (*) operator, 118-119multithreading (see threads)mutable classes, 308mutators (see set and setter methods)MVR, 118-119
Nnamed threads, 482naming conventions, 96
database access and, 594-595, 594file names, 677Java, 45
Note: boldface numbers indicate illustrations 787
M - N INDEX
naming conventions, continuedpackages in Java and, 87variables, 196-197, 202variables, 202
native modifier, 645-646native2ascii, 8NE, 125, 147negation operator, 128, 147negative numbers, Java, 187nested for loop, 163nested if, Java, 150-151nested IF, RPG, 149-150nested layout managers in (JPanel), 531-536,
533, 534nested loops, 171, 175NETLIB, 137NetScape Communications, 5new operator, 53-55, 93, 111, 226
abstract and, 381anonymous inner classes and, 642-644arrays and, 232-233, 235, 242constructors and, 79, 437null expression and, 136Statement class for SQL and, 596static methods and, 67static variables and, 65StringBuffer class and, 309strings and, 287variables, 201, 205vectors and, 257
next, 272nextElement, 404NOMAIN, 35, 36, 38NOOPT, 192not (!) operator, 126-128not equal (!=) operator, 125, 227NOT operator, 126-128notify, in Java threads, 478-480, 481, 486NOTIFY, in RPG exception handling, 422Null, 106, 185, 186null expressions, 109, 136-137null layout managers, 521null values, 226
arrays and, 246database access and, JDBC, 619
hashtables and, 272numeric conversion in data types (see also
casting), 214-222numeric data type, 182, 187, 207-209
ranges for, 207-209NUMERIC data type, 618numeric expressions, 109
OO data type, 186O specs, 39, 43Oak, as original name of Java, 4-5Object class, 360, 365, 367, 419object data type, 184object factory, 383, 416, 419object files, 31Object Management Group (OMG), 647object oriented design and analysis (OOA/D),
382-383object oriented programming, 4, 359-419, 359object reference operators, 227-228object reference variables, 54, 57, 74, 93, 198,
361, 391objects, 53, 186, 226OCCUR, 52, 249-252OCCURS, 194OFF, 106ON, 106ON ERROR group, 425op codes, 107, 108, 143OPEN, 567, 578Open Database Connectivity (ODBC), 574-575,
579, 580%OPEN, 425operating systems, 9-11, 22-23, 705
Java on System i and, OS/400, 700-702packages and support, 660threads and, 447
operators, 116-137, 142arithmetic, 117-119assignment, 119-120bitwise, 126-128, 129-132conditional, 134contracted, 120increment/decrement, 121-124
788
INDEX N - O
logical, 126-128, 147negation, 128, 147object reference, 227-228precedence of, 119, 134-136prefix and suffix, 122relational, 125-126, 147shift, 130-134side effects of, 123as statements, 123ternary, 134unary, 121-124
optimization, in database access, 573, 574or(||) operator, 126-128OR, 126-128, 147ORDER BY clause, 570org.omg, 664Original Programming Model (OPM) model,
exception handling, 422-423OS/400 and Java, 9, 700-702OTHER, 153overhead of threads, 447OVERLAY, 194overloaded concat in strings, 293overloading methods, 61, 67, 93, 370, 377
constructors and, 78-82overloading operators, 11overriding files, 28overriding methods, 360, 361, 368, 378, 379,
381, 411
PP specs, 39, 185pack method, 518package statement, 85, 92, 109packages in Java, 7, 46, 84-91, 94, 660-664
case sensitivity of names in, 88class loaders, 90CLASSPATH vs. library list in, 89compression of files in, 90-91default, 86defining, using package statement, 85directories for, 89distributing, 90-91file system and, 88import statement for, 86
jar files for, 90-91Java.lang as, 87Javac compiler and, 85naming conventions for, 87qualified names of, 85unnamed, 86-87using, 85-87
packed data type, 207, 209-214, 223, 618packed decimal data type, 183, 188PACKEVEN, 194padding in strings, 289-290, 294, 313padding space between components in user
interface, 531%PADDR, 185Panel Definition Markup Language (PDML),
710@PARAM JavaDoc keyword, 102parameter lists, Java, 48parameter passing, 34, 35-36, 56, 94, 278-283,
414arrays and, 278CallableStatement class in, 625-627Java native interface (JNI) and, 646Java, 37-38pass by reference in, 278pass by reference, simulated for RPG,
281-282pass by value in, 278, 279-280ProgramCall class in, 714-722RPG, 41, 278-281serialization and, 652stored procedures and, 625-627swap method for, 282
parameter separators, 56parameter variables, 60parameters
command line, in Java, 72command line, in RPG, 71-72
parent classes, 329, 349, 360, 368, 374-379,416, 655
parenthesesexpressions and, 127operator precedence and, 134-136
parse method to test dates/times, in Java,352-353
Note: boldface numbers indicate illustrations 789
O - P INDEX
pass by reference, 278simulated for RPG, 281-282
pass by value, 278, 279-280passing (see parameter passing)patterns, method design, 382PDM options
calls and, 675database access and, 606-614user profiles and, 677
Perl, 18PERRCD keyword, 234-235, 236, 244-248persistence, 197, 652PGM, 38physical files, in databases, 576-577PKZIP, 90PLIST, 71pointer data type, 182, 265pointers, 11, 12, 50, 55, 136, 185, 187
interfaces and, 400-401vectors and, 266
policy files, remote method invocation (RMI) inJava, 650
policytool, 8polymorphism, 361, 372-379, 399popup menus, 548-549, 546, 549portability of Java, 6, 9, 20
metadata and, 621-624packages and, 660
positioned iterators, SQLJ, 635positioned update and delete, 572, 603pow, 141, 142pre runtime arrays, 229, 243-248, 243pre/post increment/decrement expression, 108,
111precedence of operators, 119, 134-136precision, 212predicate or WHERE clause, 570preemptive time slicing, threads, 472, 472PREFIX, 488, 568prefix operators, 122PreparedStatement class, 583, 596, 617, 630primary or main method in threads, 447, 454,
464, 469primitive data types, 47, 186, 223, 225
pass by reference, simulated for RPG,281-282
vectors and, 257println, 74-78, 94printStackTrace, 428-429, 443prioritizing threads, 481-482, 486private, 46, 65, 92, 94, 362
methods, 364, 368, 378variables, 197, 205, 223
procedure interface (PI), 42procedure pointer data type, 182, 184, 185, 189,
206procedure pointers, 187, 400-401procedures, 30, 31, 34-36, 35, 38, 107, 141, 198,
362calling RPG procedures as RPG native
methods from Java in, 757-761calling, 43-44defining, 41-43exception handling and, 424, 425side effects of, 111
profiles in SQLJ, 632program call classes, 673Program Call Markup Language (PCML), 673,
709, 723-727arrays and multiple occurrence structures in,
727data structures declared in, 725-727DataQueue class in, 727-736in using RPG and Java together, 745
program errors, exception handling, 423ProgramCall class, 714-722properties
bound, 678, 680-683constrained, 683indexed, 679JavaBeans and, 678-680system, querying, 665-667
Properties classdatabase access and, drivers, 591user profiles and, 675-677
property editors for JavaBeans, 678protected, 92, 94, 360, 362
methods, 360, 364, 368variables, 197, 202, 223
790
INDEX P
prototyping, 34-35, 40-41, 11, 71, 387-409proxy objects, remote method invocation (RMI)
in Java, 648PSDS, exception handling, 424PSSR, 145, 424public, 45, 46, 70, 92, 94, 364
methods, 364, 378variables, 197, 202, 204, 223
push buttons, 550
QQCMDEXEC command analyzer and calls, 673QShell Interpreter, Java on System i, 695, 697,
702-703QUALIFIED, 195qualified data structures, defining, in RPG, 195qualified names, packages, 85queries, 571, 599
examples of, 603-605queues, DataQueue class, 727-736quotes, 75, 76, 206
in date and time manipulation, 343in String literals, 235in strings, 72, 289, 290, 293
Rrandom, 141Random and random number generation, 470ranges for numeric data types, 207-200Rational Software, 413READ, 487, 567read committed, 620READC keyword, 488READE, 567readLine method, in Java file management, 672READP, 567READPE, 567REAL data type, 618REALLOC, 11RECNO, 568record level database access, 736-744records, in databases, 576-577recursion, 34REF data type, 627
reference data type, 186, 223, 225reference fields, inheritance, 372reference variables, 186, 187, 226references, 54
arrays and, 241-243pass by reference, 278
referential integrity in database, 624regionMatches, 318registering and connecting drivers in SQLJ, 633registering programs and stored procedures, 627registry, remote method invocation (RMI) in
Java, 649-651relational operators, 125-126, 147relationships, 413, 414-415, 417releasing a thread, 478remote method invocation (RMI), 467, 647-651,
655remote procedure calls (RPC), 647remove, 273, 686removeAllElements, 258removeElement, 258, 263, 265removeElementAt, 258RENAME, 488, 568repeatable read, 620replace method, 291, 301%REPLACE, 291report writer classes, 710reserved keywords, Java, 106-107resource bundles, internationalization, 562-566result sets, 571, 599-603ResultSet class, 628-629ResultSet interface, 583ResultSetMetadata, 583, 621-622resume method, in threads, 482, 486return method, in Java, 48, 144, 145, 176-178,
179, 220RETURN, in RPG, 108, 144, 145, 164,
176-178, 179return values, 34@RETURN JavaDoc keyword, 102reuse of code, 82-91
interfaces and, 394-399packages in Java, 84-91, 660service programs for, 82-84in user interface, 490
Note: boldface numbers indicate illustrations 791
P - R INDEX
reverse method, in StringBuffer class, 310right shift (>), 130-132rint, 141rmic, 8rmid, 8rmirestiry, 8rollback, in Java, 620, 621ROLLBACK, in RPG, 569, 575, 578round, 141ROUND_DOWN/ROUND_HALF_UP, 213rounding, 211, 213rows, columns, and tables, 570, 576-577RPG and Java, 2, 3, 745-761
activation groups and, 758calling Java from, 746-757calling RPG procedures as RPG native
methods from Java in, 757-761classpath settings and, 757, 760-761data types and, mapping of, 754-756embedded SQL and, 746exceptions and, 761JAVA command for, 746Java native interface (JNI) and, 745Java Virtual Machine (JVM) and, 745,
756-757Program Call Markup Language (PCML)
and, 745RPG calling Java in, 746-757service programs and, 758threading and, 745-746
RPG cycle in database access, 568RPG II vs. RPG IV, 28-31RPG III, 27, 423-424, 423RPG IV, 2, 27, 28, 646
vs. RPG III, 28-31RPG program anatomy, 107-108RPG vs. Java, 23-24, 32-38run method, in threads, 401, 452-454, 457, 459,
460, 465, 469, 485Run SQL (RUNSQLCMD), 572RUNJVA command, 646, 703Runnable interface, 401, 454-456, 461, 462,
463, 485runtime array initialization, 236-238runtime arrays, 243, 283
Runtime class, calling another program fromJava, 672-675
RuntimeException class, 429, 430
Ssandbox, 19, 558savepoints, database access, 631scale, 212SCAN and %SCAN, 288, 291, 296-298, 296schema, in databases, 576-577scope of variables, 199-200SDA, in user interface, 489searches
arrays and, 252-255hashtables and, 275interfaces and, 399-401substrings within strings, 296-298
SECOND, 333, 338SECONDS, 331, 333Secure Socket Layer (SSL) connection, AS/400
Toolbox for Java, 712security, 12, 16, 19, 558security classes, 710@SEE JavaDoc keyword, 102SELECT, in RPG, 151-154SELECT, in SQL, 144, 145, 179, 570, 571, 572,
578, 595, 596, 599, 602, 603, 612, 634semicolon as Java statement delimiter, 97, 108,
111, 149, 235Send Program Message (SNDPGMMSG), 422,
433, 443separators
in date and time manipulation, 339, 343, 344parameters, 56
Serializable interface, 652serializable isolation level, 620serialization, 651-656
JavaBeans and, 687-688serialver, 8@SERIALxx JavaDoc keyword, 102server applications, 6service programs, 7, 30, 31-33, 32, 82-84, 99
binder language and, 83binding, 83binding directories and, 84
792
INDEX R - S
code reuse using, 82-84EXPORT and, 82-84interfaces and vs. ., 387-409Java native interface (JNI) and, 646in using RPG and Java together, 758vectors and, 265
service threads, 465servlet classes, 710servlets, 1, 5, 6, 18, 20, 489, 660, 692, 696SET, 596set and setter methods, 50, 94
data types and, 617database access and, 597-599, 620, 626, 628in date and time manipulation, 338introspection in JavaBeans and, 687JavaBeans and, 678, 680, 681, 688user profiles and, 675-677variables, 202
setDisplayedMnemonic, 501setElementAt, 258SETGT, 567setHorizontal/VerticalTextPosition, 501setHorizontalAlignment/setVerticalAlignment,
501setIcon, 501, 506setLabelFor, 501SETLL, 567setMaxRows method, 615setMaxTimeout method, 615setMnemonic, 501, 504-505SETON, 145setPriority, for threads, 481-482setSize, 258setText/getText, 501setVisible, 515severity of exception, 429SFILE keyword, 488shift operators, 130-134Short class, wrappers and to/from, 220-221short data type, 46, 187, 188, 189, 207, 217,
223, 618shortcuts for menu items, 550side effects of method/procedures, 111side effects of operators, 123signatures, 70, 93, 368, 435, 451
hasMoreElements, 404interfaces and, 389, 404nextElement, 404threads and, 455
signing applets, 19, 558SimpleDateFormat class, 323, 340-344, 346,
349, 357SimpleTimeZone, 355-357sin, 141@SINCE JavaDoc keyword, 102size method, 258, 273sleep method, threads, 459, 460, 486SLNO keyword, 488SMALLINT data type, 618Smalltalk, 11SmartGuides, for JavaBeans, 691, 691sort method
arrays and, 253, 254interfaces and, 399-401
SORTA, 253source entry utility (SEU), 33source members, 39spawning threads, asynchronous method calls,
448-456SQL (see also database access; Java Database
Connectivity; SQLJ), 568, 569-572creating statement objects for, 595-597Data Definition Language (DDL) of SQL in,
577, 598Data Manipulation Language (DML) of SQL
in, 577embedded SQL and, 746interactive vs. embedded SQL, 572-573local vs. distributed SQL in, 575-576PreparedStatement class for SQL in, 596running statements in, 597-599SQL embedded in Java (SQLJ) for, 631-636Statement class for SQL in, 596static vs. dynamic SQL in, 573-574warnings in, handling, 615-624
SQL embedded in Java (SQLJ), 631-636binding in, 633connection context in, 633Connection object in, 633, 634cursors for, 634
Note: boldface numbers indicate illustrations 793
S INDEX
SQL embedded in Java (SQLJ), continueddatabase plans in, 632exceptions and try/catch blocks in, 634iterators in, 634, 635positioned iterators in, 635preparing and compiling, 636profiles in, 632registering and connecting drivers in, 633SELECT statement in, 634translators in, 632updatable iterators in, 635writing, 633-636
SQLWarning class, 616sqrt in Java, 139, 141SQRT in RPG, 139square root, 137standalone fields, 39-40, 42, 190, 192, 193standalone statements, 109, 111Standard Edition JSDK, 692standard output, 74Start Commitment Control (STRCMTCTL), 569Start Journal Physical File (STRJRNPF), 569start method, in threads, 451-454, 452, 455, 459,
483, 485Start SQL (STRSQL), 572startsWith, 318Statement class for SQL, 583, 596, 630statements, 107, 108, 110-115, 123, 142, 143static, 61-69, 70, 93, 94, 418
arrays and, 235helper methods and, 68initializers, 644-645Java variables as, 63-65methods, 65-69, 93, 418RPG variables as, 62-63variables, 197, 198, 202, 204, 205, 223, 644
STATIC, 192, 194static final variables, 197static variables, 224static vs. dynamic SQL, 573-574STATIC, 63-64STATUS, exception handling, 422%STATUS, 425, 568stop method, for threads, 459-462, 464, 468,
471, 486
stopping a thread, 457-464stored procedures
database access and, 624, 625-627Java native interface (JNI) and, 646registering a program as, 627
stream files, 668, 670String class, 70, 214, 223, 254, 285, 287, 416, 417
methods of, 317-318sorting in, 254StringBuffer class for, 308-312StringTokenizer class for, 316-317substrings, 246vectors and, 257
string data type, 206, 618, 619StringBuffer class, 308-312
append method in, 309-310, 313capacity methods in, 313concatenation in, 309in date and time manipulation example,
326-327ensureCapacity in, 313instantiation of, 309new operator and, 309reverse method and, 310
strings, 173, 187, 283, 285-319ALL in, 289append method and StringBuffer class,
309-310, 313assigning literals in, 289BLANKS in, 289capacity in, 310-311case conversion in, 303-304CAT in, 288, 291, 292char data type and, 285%CHAR in, 291CHECK in, 288, 291, 292, 305-308checking for characters in, 305-308CHECKR in, 288, 291, 305-308codepages and CCSIDs in, 290COMP in, 288compareTo in, 318concat in, 286, 291, 293concatenation (+) operator in, 293concatenation in, 286, 292-293, 309copyValue Of, 318
794
INDEX S
embedded quotes in, 290endsWith in, 318equality in, 287equals in, 287, 318equalsIgnoreCase in, 318escape sequences for, 290EVAL and EVALR for, 288-291, 293, 298getBytes in, 318getChars in, 318IF to compare, in RPG, 288indexOf in, 291, 295-296, 297-298initialization of, 289, 287, 293instantiation of, in Java, 286international characters in, 304INZ for, 288, 289Java, 286-288lastIndexOf in, 297-298%LEN in, 291, 299-300, 299length determination in, 299-300length method in, 291, 300length of, 173MOVE/MOVEA/MOVEL in, 288new operator for, 287overloaded concat in, 293padding in, 289-290, 294, 313quotes in, 72, 289, 293regionMatches in, 318replace method in, 291, 301%REPLACE, 291reverse method and StringBuffer class in, 310RPG, 288-291SCAN and %SCAN in, 288, 291, 296-298searching for substrings in, 296-298size of, 289-290startsWith in, 318String class for, 285, 287, 317-318StringBuffer class for, 308-312SUBST and %SUBST in, 288, 291, 294-296substring method in, 291, 294-296substringing in, 294-296toCharArray in, 318tokenized strings and StringTokenizer class
for, 316-317toLowerCase and toUpperCase in, 304, 318translating characters in, 300-303
trim method for, 291, 298-299, 315%TRIM for, 291, 298-299%TRIML and %TRIMR in, 291, 299, 312trimming blanks from, 298-299, 312-316trimr and triml in Java for, 312-316truncating in, 289-290, 313%UCS2 function in, 290-291Unicode in, 290-291, 300, 304valueOf in, 291, 318VARYING keyword in, 290, 294, 300, 304,
314XLATE in, 288, 291, 292, 300-304
StringTokenizer class, 316-317STRUCT data type, 627structured operations and statements, 143-179
break statement in, 152-154, 171-174, 179case statement in, 152-154conditional operator (?:) in, 154-155continue statement in, 173-174, 179decision structures in, 144, 146-171DO loop, RPG, 156-163, 179do until, Java, 165-169, 170-171, 179DOU, RPG, 170-171, 179DOW, RPG, 165-169, 179else, Java, 146-151, 179ELSE, RPG, 146-151ENDSL in, 153FOR loop, RPG, 164-165for, Java, 156-163, 169, 179GOTO, RPG, 175, 179if, Java, 146-151, 179IF, RPG, 146-151ITER, RPG, 172-174, 179LEAVE, RPG, 171-174, 179loop structures in, 144, 155-156, 179OTHER in, 153return, Java, 176-178, 179RETURN, RPG, 176-178, 179RPG vs. Java, 145SELECT, RPG, 151-154, 179sequence structures in, 143switch statement, Java, 151-154, 179transfer structures in, 144, 171-178WHEN, 179while, Java, 165-169, 179
Note: boldface numbers indicate illustrations 795
S INDEX
struts, in user interface, 529style of coding, Java, 96SUB, 118-119, 143SUBDUR, 322, 330-335, 336, 357subexpressions, 147subfields, RPG, 193-195subprocedures, 36subroutines, 30, 31, 35, 36, 177-178, 362SUBST and %SUBST, 288, 291, 294-296substring method, 291, 294-296substringing, 246, 294-296subtraction (-) operator, 118-119SUDUR, 323suffix operators, 122super keyword, 360, 368, 517suspend method, 482, 486
threads and, 482swap method, parameter passing, 282Swing (see user interface design), 487-566switch, in Java, 144, 145, 151-154, 171, 179synchronization of threads, 472-474synchronized keyword, 445-446, 446, 473-481,
486JavaBeans and, 686
synchronous threads, 445-446, 446syntax
Java, 44-50, 95-142, 639-693RPG, 39-40
System class, in date and time manipulation,324
System i, using Java on (see Java on System i)system properties in Java, 665-667System.exit, 145, 178, 464, 510
graphical user interface (GUI) and, 465threads and, 486
System.in, 260, 487System.out, 75, 94, 260, 487SystemColor class, 498
Ttables and arrays, 229tables, in databases, 576-577TAG, 114, 145, 175tags for HTML, 12-13tags for XML, 724
Taligent, 562tan, 141TCP/IP, 5
database access and, 582iSeries Toolbox for Java and, 711remote method invocation (RMI) in Java, 651serialization and, 655
ternary operator, 134TEST, 322, 323, 351-354TESTB, 129text component methods, 502TextListener, 511-514this, 59-61
constructors and, 79JavaBeans and, 681
thrashing, 475thread pools, 476thread scheduler, 481-482ThreadDeath class, 460ThreadGroups class, 462-464, 482, 485threads, 178, 445-486
abstract in, 451alternatives to, 475-476asynchronous threading caveats, 465-476, 465atomic instructions and, 472CALL and, 445-446calling RPG procedures as RPG native
methods from Java in, 757-761calls and, 447common local and instance variables in, 447,
447, 457, 466, 471, 477Common Object Request Broker Architecture
(CORBA) and, 467concurrency and, 472-474daemon threads in, 465, 480database access and, 614-615deadlock in, 480-481, 480, 486default threads in, 465disconnected vs. connected jobs in, 446-448ending programs with running threads,
System.exit, 464entry points and, 483exceptions in, 460, 464, 471extends Thread in, 451-454fine grained synchronization in, 474-475
796
INDEX S - T
garbage collection and, 465implement Runnable in, 455-456inventory example of, dangers of, 467-472isAlive method for, 482-483, 486Java Virtual Machine (JVM) and, 447, 464jobs vs., 446-448join, 482, 484, 486lock queue and wait queue concept in,
478-479, 479locking in, 476-478, 477, 479main methods in, 483, 486mulituser applications using, 466-467, 466multiple, stopping all, using ThreadGroups
class, 462-464, 482named threads in, 482notify, 486operating system support for, 447overhead of, 447primary or main thread in, 447, 454, 464, 469prioritizing of threads in, setPriority,
481-482, 486releasing a thread in, 478Remote Method Invocation (RMI) and, 467resume method in, 482, 486in using RPG and Java together, 745-746run method in, 452-454, 457, 459, 460, 465,
469, 485Runnable interface and, 454-456, 461, 462,
463, 485service threads in, 465signature of method and, 451, 455single objects with multiple threads in, 467singletons in, 466sleep method in, 459, 460, 486spawning, asynchronous method calls,
448-456start method in, 451-454, 452, 455, 459, 483,
485stop method in, 459-462, 464, 468, 471, 486stopping, 457-464suspend method in, 482, 486synchronized keyword in, 473-475, 476-481,
486synchronizing asynchronous execution in,
472-474
synchronous vs. asynchronous, 445-446, 446System.exit and, 465, 486, 510thrashing and, 475Thread class in, 485thread pools and, 476thread scheduler for, 481-482ThreadDeath class, 460ThreadGroup class, 485time slicing in, preemptive, 472, 472timing applications in, 483-485transaction threads in, 465, 469in user interface, 510voluntary stopping in, 464wait and notify in, 478-480, 481, 486yield method in, 482, 486
throw, 144, 145, 179, 427, 433-437, 441, 443Throwable class, 427, 428-431, 433, 441throws clause, 427, 428, 435, 443@THROWS JavaDoc keyword, 102TIME, 321, 322, 323Time class, 602time data type, 182, 184, 185, 189, 206, 618TIME data type, 618time slicing, threads, preemptive, 472, 472time zones, 348, 355-356TIME, 327-330Timestamp class, 602timestamp data type, 182, 184, 185, 189, 206,
618TIMESTAMP data type, 618TimeZone class, 323, 355-356, 357TIMFMT, 323, 344-346, 357timing threaded applications, 483-485TINYINT data type, 618Tip Calculation applet example, 558-561, 561tnameserv, 8toCharArray, 318TOFILE keyword, 236, 244-248tokenized strings and StringTokenizer class,
316-317tool tips, 500, 500toolbars and JToolBar class, 550-551tools in JDK, 7-8
Note: boldface numbers indicate illustrations 797
T INDEX
toStringdate and time manipulation, 326overriding, 411vectors and, 258
toUpperCase and toLowerCase, 304, 318transaction threads, 465, 469transfer statements, 109transfer structures, 144, 171-178transient variables, 197, 223transient modifier, 655translating string characters, 300-303translators in SQLJ, 632triggers in database access, 624trigonometry, 137trim method, 291, 298-299, 315%TRIM, 291, 298-299%TRIML and %TRIMR, 291, 299, 312trimming blanks from strings, 298-299, 312-316trimr and triml, strings, in Java, 312-316trimToSize, 258Trojan horses, 379true/false, 113, 149, 154, 167, 168, 187, 214-215truncating, in strings, 289-290, 313truncation warnings in database access, 616try/catch blocks, 144, 145, 179, 222, 437-443
database access and, 596exception handling and, 427, 428, 429,
434-437, 442serialization and, 654SQLJ and, 634static initializers and, 645threads and, 460
UUCS-2 data type, 182, 184UCS-2 varying data type, 184%UCS-2 function, 290-291UDATE, 321UDAY, 321, 322UMONTH, 321, 322unary operator, 117, 121-124, 147unbalanced arrays, 248-249, 283unicast events, 687Unicode, 185, 187, 223, 290-291, 304Unified Modeling Language (UML), 413
uniform resource locator (URL), 15-16unique identifier for variables, 204UNIX, 18, 698-700, 705UNLOCK, 567unnamed packages, 86-87, 86unsigned data type, 183, 184, 187, 188, 189, 207updatable iterators, 635UPDATE, 567, 571, 572, 578, 595, 596, 598,
599, 603, 612Update Program (UPDPGM), 30Update Service Program (UPDSRVPGM),
30-31, 30USA format, 322, 339, 344, 345, 348, 352usage of class, 414USC-2 data type, 185user interface design and Swing, 16-19, 20,
487-566Abstract Windowing Toolkit (AWT) for, 488AbstractButton class, 502actions associated with menus in, 551adapter classes in, 513add method in, 492applets vs. applications in, 557-561base class for frame windows in, 516-517basic components for, 494-514, 496BorderLayout manager in, 520, 521-523, 523borders in, 498-500, 499BoxLayout manager in, 521, 529-531, 530,
531button component methods in, 502button state methods for, 507CALL, 488CardLayout manager in, 521cascading menus in, 547colors in, 497-498Component class, 493conditional logic vs. indicators in, 490constraints in GridBagLayout manager,
525-526Container classes, 493containers for, 491, 515-543, 552, 552context menus in, 548default push buttons in, 550dialogs in, message and simple input,
556-557, 556, 557
798
INDEX T - U
dialogs, predefined, 553-555display files and, 487-488, 490, 519encapsulation of classes for, 490events in, 492, 509-514, 643EXFMT, 510F specs and, 487-488FlowLayout manager in, 520, 523-524, 524focus in, 513fonts in, 498form panels in, 536-543, 540, 541GridBagLayout manager in, 521, 525-528,
525, 527, 528GridLayout manager in, 520, 524-525, 525GUI Builder in, 710hierarchy of classes in, 493IGNORE/INCLUDE in, 488images in, 505-508inherited methods commonly used in,
496-500instantiating and initializing objects in, 495interfaces and, 402iSeries Toolbox for Java and, 710Java and, 488-566Java plug ins for browsers and, 561JavaServer Pagers in, 489JButton in, 491, 494, 496, 502, 506, 509, 514,
550JCheckBox in, 491, 494, 496, 502, 506, 509JCheckButton, 514JColorChooser dialog in, 553-555, 555JComboBox, 494, 496, 503, 509, 514JComponent, 493JDialog, 119, 491, 515-543, 519JFileChooser dialog in, 553-555JFrame in, 491, 515-543JLabel, 493, 494, 496, 506, 509, 543JList, 494, 496, 503, 509, 514JList, 508, 508JOptionPane class for, 556-557, 556, 557JPanel in, 491, 515-543JPasswordField, 494, 496, 502, 509, 514, 543JProgressBar, 551JRadioButton, 494, 496, 502, 506, 509, 514JScrollPanel, 494, 496JSlider, 551
JSplitPane, 552JTabbedPane in, 521, 552JTable, 551JTextArea, 494, 496, 502, 509, 514JTextComponent class, 502JTextField, 494, 496, 502, 509, 514JTextFields in, 543-545JTextPane, 551, 552JTree, 551layout managers for, 492, 519-531list component methods in, 503listeners for events in, 511-514, 643locales for internationalization in, 562-563look and feel settings for, 552-553, 555menu bars and popups in, 545-550, 546mnemonics in, 504-505, 504, 505, 518modal behavior in, 518model view controller (MVC) in, 508-509multiple document interface for
(JDesktopPane and JInternalFrame), 551nested layout managers in (JPanel), 531-536,
533, 534noninherited methods commonly used in,
501-508null layout managers in, 521pack method in, 518padding space between components in, 531Panel Definition Markup Language (PDML)
in, 710popup menus in, 548-549, 549PREFIX, 488READ, 510READC keyword in, 488RENAME, 488reuse of code in, 490RPG IV and, 487-488SDA and, 489servlets and, 489setDisplayedMnemonic, 501setHorizontal/VerticalTextPosition, 501setHorizontalAlignment/setVerticalAlignment,
501setIcon, 501, 506setLabelFor, 501setMnemonic, 501, 504-505
Note: boldface numbers indicate illustrations 799
U INDEX
user interface design and Swing, continuedsetText/getText, 501setVisible, 515SFILE keyword in, 488shortcuts for menu items in, 550sizing components in, 543-544sizing windows in, 518SLNO keyword in, 488struts in, 529Swing classes for, 489System.exit and, 465, 510System.in and System.out vs., 487text component methods in, 502text input restrictions for JTextFields, 544-545thick vs. thin GUIs in, 489threads and, 510Tip Calculation applet example for, 558-561,
561tool tips in, 500, 500toolbars and JToolBar class for, 550-551translating to other languages in, resource
bundles for, 562-566Visual Composition Editor and, 489VIsualAge for Java and, 488
User Interface Manager (UIM), 12user profiles, 193, 675-677uses relationship, 415USROPN, 568utility classes, 710UYEAR, 321
VVALUE keyword, pass by value in, 279-280valueOf, strings, 291, 318VALUES clause, 596VARBINARY data type, 618VARCHAR data type, 619VARGRAPHIC data type, 619variables, 35, 38, 108, 181-223, 412
accessing, in Java, 48-49activation groups and, 200-201allocating/deallocating memory for, 201automatic fields and, 201binding, 202boolean, 149
C specs in, 191case sensitivity in, Java, 105-107class, 65, 96, 225, 644D specs in, 191-192declaring in Java, 46-47, 108, 181defining, in Java, 195-198defining, using DEFINE, RPG, 190-195example of, in Java, 202-205external access to, 201-202final, 197, 198, 223, 224getter methods and, 202global, 38, 59, 199-200, 223, 466instance, 93IMPORT and EXPORT, 201-202initialization of, 51, 108, 191-193, 196,
205-207, 224instance, 55, 68, 96, 167, 198, 201, 204, 418,
447, 457, 466, 471, 477Java, 46-47lifetime of, 200-201LIKE keyword for, in RPG, 191literals and, 205-207local, 36, 55, 60, 63-64, 199-201, 205, 223,
447, 457, 466, 471, 477modifiers for, 197, 223naming, 105-107, 142, 196-197, 202new operator and, 201, 205null values in, 226object reference, 54, 57, 74, 93, 198, 361, 391parameter, 60persistence in, 197primitive data types as, 225private, 197, 205, 223protected, 197, 202, 223public, 197, 202, 204, 223reference data types as, 225reference, 186, 187, 226scope of, 199-200setter methods and, 202static final, 197static, 62-64, 197, 198, 202, 204, 205, 223,
224, 644stringing together, 120threads and, 447, 447, 457, 466, 471, 477transient, 197, 223, 655
800
INDEX U - V
type of, 181unique identifier for, 204volatile, 197, 223
VARSIZE, 73VARYING keyword, 183, 173, 290, 294, 300,
314, 304Vector class, 365, 378vectors, 256-271, 283
addElement for, 257, 262allocating/deallocating memory and, 256,
264-271arrays and, 229Attendee class example for, 263-264AttendeeList class example for, 261-263BASED keyword and, in RPG, 271capacity in, 257casting and, 262-263clone in, 257contains in, 257, 263, 265copyInto in, 258elements in, 256, 258ensureCapacity in, 258Enumeration interface and, 403-409equals in, 263, 265, 283firstElement in, 258growing or shrinking size of, 256, 283hashtables and, 271-278indexOf and indexing in, 258, 266insertElementAt in, 258isEmpty in, 258lastElement in, 258lastIndexOf in, 258linked list program and, 267lists and, 265, 267new operator for, 257pointer data type and, 265, 266primitive data types and, 257Registration class example for, 259-261removeAllElements in, 258removeElement in, 258, 263, 265removeElementAt in, 258RPG and, simulating vectors in, 264-271service programs and, 265setElementAt in, 258setSize in, 258
size of, 256, 258, 283toString in, 258trimToSize in, 258Vector class for, 256
verify method, exception handling, 437@VERSION, JavaDoc keyword, 102views, in databases, 576-577visual classes, iSeries Toolbox for Java, 709Visual Composition Editor (VCE), 489, 690VisualAge Developer Domain, JavaBeans, 692VisualAge RPG and database access, 575VisualCafe, 8void, 47, 56, 70, 94volatile variables, 197, 223
Wwait, in threading, 478-481, 486warnings, JDBC, 615-624Web browsers, 5, 16, 558, 561Web-enabled applications, 2Web servers, 15, 16, 17Web Services, 1WebFacing, 2WebSphere Development studio (WDS), 2, 8, 9, 33
Java on System i and, 696, 701, 705JavaBeans and, 690, 690, 691in user interface, 489
WebSphere Application Server, 18, 631, 692WebSphere Development Tools, 582WebSphere Studio Site Developer, 9WebSphere Studio Application Developer, 9WEEK_OF_YEAR, 337WHEN, 108, 152, 164, 179WHERE clause, 570while loops, Java, 111, 112, 114, 121, 144, 145,
155-156, 165-169, 171, 179, 215white space, in Java, 46, 95, 97, 109, 231WindowListener, 511-514Windows look and feel GUI, 555, 555WinZip, 90working directory in Java, 664-667wrappers for data types, in Java, 220-224WRITE, 379
database access and, 567in user interface, 487
Note: boldface numbers indicate illustrations 801
V - W INDEX
XX/Open standards for database access, 574x= operator, 121XFOOT, array summing, 255XLATE, 288, 291, 292, 300-304XML, 1, 724
YYEAR, 322, 333, 337YEARS, 331, 333
yield method, 482, 486YMD, 339, 344
ZZADD, 118-119zero fill right shift (>>) operator, 130-134Zip compression, 90ZONE_OFFSET, 338zoned decimal data type, 183, 188, 207, 223ZSUB, 118-119
802
INDEX X - Z