ISBN13: 9781565926165 ISBN10: 1565926161 All Product Details
[ A ], [ B ], [ C ], [ D ], [ E ], [ F ], [ G ], [ H ], [ I ], [ J ], [ K ], [ L ], [ M ], [ N ], [ O ], [ P ], [ Q ], [ R ], [ S ], [ T ], [ U ], [ V ], [ W ], [ X ], [ Y ], [ Z ] A[ Top ] aborting transactions (see ROLLBACKs) absolute( ), 48 AbstractTableModel class, 211 access, database (see databases, access) accessibility issues, user interface, 9 ActionEvent, 219 actionPerformed( ), 220 ActiveX technology, 7 Adabas D, 31 addBatch( ), 64 addPropertyChangeListener( ), 139 afterLast( ), 47-49 Agave Software Design, 31 Altera Software, 32 alternate type mapping, 77 Animation API, 8 APIs, Java, 6-8 application assembler, EJB, 118 application servers database security, 164 RMI, 114 three-tier architecture, 134 applications, database (see database applications) AppServer object, 113 architecture distributed application, 126-145 strategic vs. tactical thought, 127 three-tier (see three-tier architecture) two-tier client/server (see two-tier architecture) Array class, 75, 227-229 arrays, SQL, 75, 227-229 Asgard Software, 32 authenticate( ), 158 Authenticator interface, code examples, 157-160 auto-commit, 42, 186 turn off during batch processing, 65 turned off for distributed transactions, 99 B[ Top ] banking application, 143-145 authentication of clients, 157-161 business objects, 134 distributed components, 147-150 distributed listener pattern, 139 persistence issues, 144, 184 search mechanism, 171 UI component model, 215 BaseEntity class, 162, 168-170 persistence delegation, 194 Persistent interface implementation, 192 batch processing, 62-67 updatable result sets and, 67 BEA WebLogic, 8, 32 bean class methods, 121 bean-managed persistence, 124, 147 Beans API (see JavaBeans API) beans (see entity beans; session beans) beforeFirst( ), 48 Binary Large Object datatype (see BLOB) bind( ), 107 binding, object, 106, 109 binding parameters, 58 BLOB (Binary Large Object) datatype, 71-75 Blob class, 230 Borland International, Inc, 8 bridging technology, 30 Bulletproof Corporation, 8 business objects, 9 accessing, 170-172 application server and, 114 banking application, 144 mid-tier, 134-136 business patterns, 140-142 business rules, 134 business transactions and process-oriented components, 148 C[ Top ] caching component attributes, 173 CallableStatement class, 61, 231-234 batch processing, 64 Blob/Clob objects and, 73 when to use, 63 Caribou Lake Software, 32 case sensitivity, SQL keywords, 19 centralized data processing, 134 Centura Software, 32 Character Large Object datatype (see CLOB) Chomsky, Noam, xv, 25 classes, 126 Class.forName( ).newInstance( ), 36 connecting to databases, 37-39 for database access, 39 serializing, 114-116 support, 50 Class.forName( ).newInstance( ), 36 client patterns, 138 client/server architecture two-tier, 128-133 CLOB (Character Large Object) datatype, 71-75 Clob class, 234-236 close( ), 41 Cloudscape, Inc., 32 Codd, E.F., 16 code reuse, 132 collections and entity relationships, 181 Collections API, 77, 120, 181 column binding, 60 Commerce API, 7 commit( ), 170 JDBC transactions, 192 COMMITs, 23 auto-commit, 42, 186 Compaq, 32 component attributes, caching, 173 component model (JavaBeans), 116 component security (see security issues, components) composite pattern, 140 CONCUR_READ_ONLY concurrency type, 67 concurrency modes, 197 CONCUR_UPDATABLE concurrency type, 67 connecting to databases, 34-39 difficulty with, 35 Connection class, 36, 236-242 auto-commit, 42, 186 connecting to databases, 37-39 DatabaseMetaData class and, 81, 242-247 connection pooling, 95, 195, 296, 298 ConnectionEvent class, 293-295 ConnectionEventListener interface, 295 ConnectionPoolDataSource interface, 296 connectivity, database, 12, 133 container provider, EJB, 118 container-managed persistence, drawbacks of, 124, 147 contexts, JNDI, 107 controllers (GUI components), 208 CORBA (Common Object Request Broker Architecture), 108 Core API Java, 6 JDBC, 57-91, 227-292 CREATE statement, 20 create( ) EJB home interface and, 120-124 persistence delegate pattern and, 143 createStatement( ) scrollable result sets and, 46 cross-reference tables, 18 custom socket factories, 162 Cyber SQL Corporation, 8 D[ Top ] data access patterns, 142 data models, 18 data stores saving to/restoring from, 142, 185 three-tier architecture, 134 transaction management issues, 169 two-tier architecture, 131 data tables adding to, 20 creating, 20 cross-reference, 18 modifying, 21 removing data from, 21 database applications models for, 210-219 three-tier model, 215-219 two-tier model, 210-215 database engines, 12 database independence, 29 binary/character data and, 73 database servlet (example), 51-56 DatabaseMetaData class, 81, 242-247 databases access, 39-43 constructing a model for, 211-215 distributed transactions and, 99-101 home interface and, 170-172 via JNDI, 93, 106 concurrency modes, 197 connecting to, 34-39 difficulty with, 35 connectivity of, 12, 133 Java interaction with, 10 Java's advantages for, 12-14 modifying, 41-43 object, 11 object-relational, 11 relational, 11, 15-19 security issues, 164 URLs for, 29, 35 using JDBC 2.0 Optional Package, 92 DataRamp, Inc., 8 DataSource interface, 93, 297 DataTruncation class, 51 datatypes advanced, 71-79 Java and SQL, 44-46, 77 Date class, 51, 248 deadlocks, 170 default type mapping, 77 delegates (see persistence delegate pattern) DELETE command, 21 deleteRow( ), 69 Dennett, Daniel, xvi, 57 deployer, EJB, 118 Derrida, Jacques, xv, 3 Descartes, René, xv, 15 design patterns (see patterns, design) Dharma Systems Inc., 8 directory services, 93, 106 DataSource interface, 297 dirty reads, 70 dirty writes, 132 optimistic concurrency and, 197 DISTINCT type (SQL), 76 distributed application architecture, 126-145 distributed component model (EJB), 116 distributed components, 147-182 caching attributes, 173 entity relationships, 172-182 lookups/searches, 170-172 persistence issues, 183-206 persistent, 148-156 process-oriented, 148 security issues, 156-164, 167-169 transaction management of, 165-170 unique identifiers, 149-156 distributed computing issues for distributed listener pattern, 139 Java built-in support for, 9 distributed listener pattern, 139, 219-221 drawbacks to, 220 distributed transactions, 99-101 XAConnection interface, 314 doGet( ), 52 doPost( ), 55 double quotation marks ("), 19 Driver class, 36, 249-251 connecting to databases, 37 driver property information, 82 DriverManager class, 29, 36, 251-253 connecting to databases, 37 DriverPropertyInfo class, 82, 253-255 drivers bridging technology, 30 JDBC, 31-33 downloading, 30 scrollable result sets, handling, 49 mSQL-JDBC, 27, 30 property information, 82 registering, 36, 93 types, 30 E[ Top ] EJB (Enterprise JavaBeans), 116-125 application development roles, 118 bean class methods, 121 entity beans, 119-124 primary keys for, 121, 148 entity relationships, 172-181 façades, 173-181 finder methods, 120-124 home interface, 119-122, 170-172 JDBC and, 124 JNDI support in, 120 session beans, 119 shortcomings of, 146 transaction management, 165-170 vs. RMI, 116 (see also JavaBeans API) ejbCreate( ), 122 EJBObject class, 119 Embedded API, 7 encryption network communications, 162 password, 160 preventing access forgery, 161 end( ), 192 Ensodex, Inc., 32 Enterprise API, 7 Enterprise JavaBeans (see EJB) enterprise systems, 3-6 requirements for, 5 entities (database tables), 18 entity beans, 119-124 primary keys for, 121, 148 (see also persistent components) entity relationships, 172-181 EntityBean method, 121 Enumeration interface, 121, 217 event queues, Swing API, 209 long-lived events occurring in, 219 exception handling distributed transactions, 99 JDBC, 38, 50 remote method calls, 113 transactions, 167 execute( ), 80 executeBatch( ), 64 executeStatement( ), 87 executeUpdate( ), 40, 42 exporting objects, RMI, 111 F[ Top ] façades, 205 code example, 173-181 distributed listeners and, 220 factory pattern, 141 custom client socket factory, 163 fat clients, two-tier architecture, 131 find( ), 170 findByPrimaryKey( ), 121 finder methods (EJB), 120-124 first( ), 48 FormWeb, Inc., 32 G[ Top ] generate( ), 152 generateSequence( ), 152 getBlob( ), 72 getBundle( ), factory method, 141 getClob( ), 72 getColumnCount( ), 88 getColumnDisplaySize( ), 88 getColumnLabel( ), 88 getColumnType( ), 88 getConnection( ), 195 getDefault( ), factory method, 141 getFindSQL( ), 205 getLastUpdateID( ), 197 getLastUpdateTime( ), 197 getMetaData( ), 81 getPropertyInfo( ), 82 getResultSet( ), 80 getRow( ), 49 getString( ), 76 getTransactionIsolation( ), 71 getUpdateCounts( ), 65 getWarnings( ), 51 GIE Dyade, 32 GNU, 32 GUI (see user interface) Gupta Corporation, 8 GWE Technologies, 32 H[ Top ] Heidegger, Martin, xvi, 146 Hit Software, 32 HOB electronic GmbH & Co. KG, 32 home interface (EJB), 119-122, 170-172 Hughes Technologies, 27 I[ Top ] IBM, 8, 32 ID generation, 55 sequence generators and, 149-156 Identifier class, 161 identity tokens and authentication, 157, 160 IDL (Interface Definition Language), 7 IDS Software, 32 I-Kinetics, 32 Imaginary, 32 i-net software, 32 Information Builders, 32 Informix Corporation, 8, 32 init( ), 52 initial contexts, JNDI, 107 INSERT statement, 20 insertRow( ), 69 instances, reusing, 132 InterBase, 32 Interface Definition Language (IDL), 7 interfaces home/remote (EJB), 119-122 remote (RMI), 110 internationalization factory classes and, 141 Java built-in support, 8 requirement for enterprise systems, 5 InterSoft, 8, 32 Intersolv, 8, 32 invokeAndWait( ), 209 invokeLater( ), 209 invokeWorker( ), 223 isAfterLast( ), result set position, 49 isBeforeFirst( ), result set position, 49 isFirst( ), result set position, 49 isLast( ), result set position, 49 isolated database connectivity, 133 IteratorEnumeration class, 217 J[ Top ] Java APIs, 6-8 database programming with, 12-14 interacting with databases, 10 null vs. SQL NULL, 40 object types, 76 platform independence, 6-8 servlet example, 51-56 SQL datatypes, mapping, 44-46, 77 Java DataBase Connectivity (see JDBC) Java Naming and Directory Interface (see JNDI) Java Virtual Machine (JVM), 6 zero-install client concept, 12 JavaBeans API, 7 property change events and, 173 result sets and, 96-99 rowsets and, 96-99, 300-314 (see also EJB (Enterprise JavaBeans)) JAVA_OBJECT type, 77 Java-relational DBMS, 76 JavaSoft, 32 JDBC, 7 alternatives to, 33 API for, 10 Core API classes/interfaces, 227-292 DataSource interface, 93, 297 drivers, 31-33 downloading, 30 scrollable result sets, handling, 49 EJB methods and, 124 exception handling, 38 handling NULL values, 54 meta-data classes, 79-91 SQL terminal monitor application, 82-91 persistence operations, 195-206 prepared statements, 57-59 SQL arrays, 75, 227-229 stored procedures, 60-62 structure of, 27-30 support classes, 50 URLs, 29, 35 using JDBC 2.0 Optional Package, 92 vs. ODBC, 26, 34 warnings, 51 JDBC 2.0 features, 24 advanced datatype support, 71-79 batch processing, 62-67 datatype mappings, 45, 77 Optional Package, 92-101, 293-316 connection pooling, 95, 195 distributed transactions, 99-101 naming and directory services, 93, 106, 297 rowsets, 96-99, 300-314 scrollable result sets (see result sets, scrollable) updatable result sets (see result sets, updatable) jdbc.drivers property registering a driver, 36 JDBC-ODBC bridge, 26, 30 JNDI (Java Naming and Directory Interface), 105-108 connection pooling and, 95 contexts, 107 database access, 93, 106 object binding, 106 object lookup, 107, 171 support in EJB, 120 joins (SELECT statements), 22 JTable UI delegate, 210 JTree class, 208 avoiding data overload, 217-219 JVM (Java Virtual Machine), 6 distributed objects and, 108 zero-install client concept, 12 K[ Top ] Kant, Immanuel, xi, xv KonaSoft, Inc., 32 L[ Top ] last( ), 48 LDAP servers, 94 Liberty Integration Software, 32 listener pattern, 138 listeners, distributed (see distributed listener pattern) load( ), persistence delegate pattern and, 143 logical data models, 18 long-lived events executed by worker threads, 221-223 handling, 209 occurring in event queues, 219 lookup, objects EJB (Enterprise JavaBeans), 170-172 JNDI (Java Naming and Directory Interface), 107, 171 RMI (Remote Method Invocation), 117 Lotus Development, 32 M[ Top ] Management API, 7 marshaling, remote method calls, 112 Media API, 7 Media Frameworks API, 7 Memento class, 194 memento pattern, 143 separating business logic and persistence logic, 194 meta-data classes, JDBC, 79-91 SQL terminal monitor application, 82-91 mid-tier business objects, 134-136 model objects (GUI components), 208 event handling, 209-211 model-delegate pattern, 138, 208 models, database application, 210-219 model-view-controller (MVC) pattern, 138, 208 modification state, 185 moveToCurrentRow( ), 69 moveToInsertRow( ), 69 MsqlDataSource class, 94 mSQL-JDBC driver, 27 JDBC URL for, 30 multithreading, Swing API, 209 MVC (model-view-controller) pattern, 138, 208 N[ Top ] NAA (Network Application Architecture), 136 banking application, 143 Naming class, 111 naming services, 93, 106 DataSource interface, 297 Naming.rebind( ), 109 NetAway, 32 Network Application Architecture (NAA), 136 banking application, 143 network security, 162-164 next( ), 40, 47-49 Nietzsche, Friedrich, xvi, 92 node identifiers, ID generation, 149-152 nodes, root, 215-219 Nogginware Corporation, 33 nonremote objects, passing, 114-116 n-tier architecture (see three-tier architecture) null values, SQL NULL vs. Java null, 40 O[ Top ] object databases, 11 Object Design, 8 Object Management Group (OMG) IDL specification, 7 object serialization, 114-116 object servers, accessing remote objects, 109, 113 object-relational databases, 11 objects binding (JNDI), 106 exporting, 111 lookup EJB, 170-172 JNDI, 107, 171 RMI, 117 modification state of, 185 passing nonremote, 114-116 remote (see RMI) reuse of, 132 ODBC (Open DataBase Connectivity) vs. JDBC, 26, 34 ODBC-JDBC bridge, 26, 30 OMG (Object Management Group) IDL specification, 7 Open DataBase Connectivity (ODBC) vs. JDBC, 26, 34 Open Horizon, 8 OpenLink Software, 8, 33 optimistic concurrency mode, 197 Optional Package (see JDBC 2.0 features, Optional Package) Oracle Corporation, 8, 33 P[ Top ] parameters, binding, 58 passwords, unencrypted, 160 patterns, design, 137-143 business, 140-142 client, 138 composite, 140 data access, 142 distributed listener (see distributed listener pattern) factory, 141 custom client socket factory, 163 listener, 138 memento, 143, 194 model-delegate, 138, 208 model-view-controller (MVC), 138, 208 persistence delegate (see persistence delegate pattern) permanent transactions (see COMMITs) persistence, 183-206 banking application, 144 bean-managed, 124, 147 container-managed, drawbacks of, 124, 147 database transactions and, 183-193 impartiality needed for component model, 184 key behaviors of, 185 modification state, 185 of objects, 142, 185 RMI, no built-in support for, 117 search support, 197-206 separating business logic and persistence logic, 193 using design patterns, 194 persistence delegate pattern, 142 interface behaviors, 143 JDBC persistence, 196 search support, 197 separating business logic and persistence logic, 194 persistence library architecture of, 184 searching for objects using, 170 using JDBC classes, 195 Persistence Software, 8 PersistenceSupport interface, 194, 197 persistent components, 148-156 (see also entity beans) pessimistic concurrency mode, 197 phantom reads, 70 physical data models, 18 platform independence, Java, 6-8 polling threads, 221 PooledConnection interface, 298 pooling, connection, 95, 195, 296 portability date handling, 51 stored procedures and, 61 prepareCall( ), 61 prepared statements, 57-59 vs. stored procedures, 63 PreparedStatement class, 58, 255-258 batch processing, 64 Blob/Clob objects and, 73 when to use, 63 prepareStatement( ), 59 prepareUpdate( ), 168, 185 Presence Information Design, 8 previous( ), 47-49 primary keys, entity beans, 121, 148 printComments( ), 53 Pro-C Ltd., 8 process-oriented components, 148 (see also session beans) processResults( ), 87 methods used by, 88 properties file, for JDBC configuration, 37 PropertyChangeEvent, 173 distributed listeners and, 220 PropertyChangeListener, 220 PropertyChangeListener interface, 139 provider, EJB, 118 Q[ Top ] queries, 39-43 ResultSet class and, 40 subqueries, 22 (see also SELECT statement) query plans, building, 57-59 quotation marks, 19 R[ Top ] rebind( ), 109 Recital Corporation, 8, 33 reconnect( ), 173-181, 221 Ref class, 76, 259 REF type (SQL), 76 refreshRow( ), 71 registerOutParameter( ), 62 relational databases, 11, 15-19 object persistence and, 142 relative( ), 48 Remote interface, 110, 119 remote interfaces EJB (Enterprise JavaBeans), 119-122 RMI (Remote Method Invocation), 110 remote method calls marshaling/unmarshaling, 112 RemoteException, 113 skeletons/stubs, 112 Remote Method Invocation (see RMI) remote objects (see RMI) RemoteException, 113 remove( ), persistence delegate pattern and, 143 repeatable reads, 70 ResourceBundle class, 141 result set concurrency, 46, 67 result sets navigation of, 47-49 rowsets and, 96-99, 300-314 scrollable, 46-50 optimization of, 49 transaction isolation, 70 types, 46 updatable, 67-71 deleting values, 69 getting the latest data, 71 inserting new rows, 69 updating values, 68 using batch processing instead, 68 visibility of changes in, 69-71 ResultSet class, 259-273 queries and, 40 ResultSetMetaData class and, 79-81 rowsets and, 97 scrollable result sets, 46-50 ResultSetMetaData class, 79-81, 273-277 reuse of objects, 132 of source code, 132 RMI (Remote Method Invocation), 7 accessing remote objects, 13, 109, 113 application servers, 114 binding objects to URLs, 109 creating remote interfaces, 110 distributed computing support, 9 encrypting network communications, 162-164 exporting objects, 111 marshaling/unmarshaling, 112 object servers, 113 shortcomings of, 116 skeletons/stubs, 112 structure of, 108-113 vs. CORBA, 108 vs. EJB (Enterprise JavaBeans), 116 rmic (RMI compiler) command, 111 RogueWave Software, 8 rollback( ), 170 JDBC transactions, 193 ROLLBACKs, 23 mSQL and, 30 root nodes, 215-219 RootNode class (code example), 215-217 RowSet interface, 97-99, 300-306 constructing a model for database access, 211-215 RowSetEvent class, 306 RowSetInternal interface, 307 RowSetListener interface, 98, 308 RowSetMetaData interface, 309-312 RowSetReader interface, 313 rowsets, 96-99, 300-314 JavaBeans events, 98 RowSetWriter interface, 313 rules (see business rules) run( ), 209 S[ Top ] Sartre, Jean-Paul, xvi, 207 SAS Institute Inc., 8, 33 save( ), 220 SCO, 8, 33 scrollable result sets (see result sets, scrollable) SearchBinding class, 171 SearchCriteria class, 171, 205 searching for objects (see lookup, objects) using the persistence delegate, 197-206 secure socket layer (SSL) sockets, 162 Security API, 8 security issues components authentication, 156-161 identity tokens, 157, 160 unencrypted passwords, 160 validation, 161 databases, 164 distributed systems, 156-164, 167-169 networks, 162-164 RMI (Remote Method Invocation), 116 SELECT statement, 22, 39-43 (see also queries) sequence generators, ID generation, 149-156 SequenceGenerator class, code examples, 150-152, 153-156 Serializable interface, 115 serialization, object, 114-116 Server API, 8 server provider, EJB, 118 service providers, JNDI, 106 servlets, Java, 8 session beans, 119 (see also process-oriented components) SessionBean method, 121 setAutoCommit( ), 42 setBlob( ), 73 setClob( ), 73 setFetchDirection( ), 49 setFetchSize( ), 49 setString( ), 76 Simba Technologies, Inc., 33 single quotation marks ('), 19 skeletons and remote method calls, 112 Socket class, 162 sockets, 162-164 custom socket factories, 162 Software AG, 33 Solid Information Technology, 33 source code reuse, 132 special exception, remote methods, 113 SQL language, 10, 19-23 arrays, 75, 227-229 Java datatypes, mapping, 44-46, 77 NULL vs. Java null, 40 prepared statements, 57-59 SQL2, 23 datatype support, 44, 71 SQL3, 24 array objects, 227-229 datatype mappings, 45 datatype support, 76 structured types, 287 SQL/92, 23 stored procedures, 60-62 transaction logic, 23 VARCHAR datatype, 44 SQLData class, 277 SQLException class, 50 SQLInput class, 279 SQLJ paradigm, 34 SQLOutput class, 280-282 SQLWarning class, 51 SSL (secure socket layer) sockets, 162 StarQuest Software, 33 Statement class, 39, 282-287 batch processing, 64 execute( ) and, 80 PreparedStatement interface and, 58 when to use, 63 store( ), persistence delegate pattern and, 143, 196 stored procedures, 10, 60-62 vs. prepared statements, 63 Struct class, 76, 287 STRUCT type (SQL), 76 stubs and remote method calls, 112 subqueries, 22 Support class (full source code), 197-205 support classes, 50 Swing API, 138, 208-223 distributed listeners, 219-221 event queues, 209 handling long-lived events, 209 model-delegate architecture, 208 multithreading in, 209 MVC (model-view-controller), 208 three-tier database applications, 215-219 tree component support, 215 two-tier database application, 210-215 UI delegates, 208 monitoring models for changes, 219-221 worker threads, 221-223 SwingUtilities class, 209 Sybase, 8, 33 Symantec, 8, 33 system administrator, EJB, 118 T[ Top ] TableModel mode, 211 Telephony API, 8 ThinWeb SoftWare, 33 threads, Swing API, 209 three-tier architecture, 133-136 banking application, 143 centralized data processing, 134 data presentation, 135 drawbacks to, 136 Network Application Architecture, 136 three-tier database applications, 215-219 Thunderstone, 8 Time class, 51, 288 Timestamp class, 51, 289-291 tjFM, 33 /tmp/jdbc directory, 107 tokens, identity, 157, 160 Transaction class, 166-169 generic transaction logic (code example), 186-192 transaction isolation, 70 transaction management, 10 EJB (Enterprise JavaBeans), 165-170 TRANSACTION_NONE, 70 TRANSACTION_READ_COMMITTED, 70 TRANSACTION_READ_UNCOMMITTED, 70 TRANSACTION_REPEATABLE_READ, 71 transactions, 23 aborting (see ROLLBACKs) boundaries, 166 deadlocks, 170 distributed, 99-101 exception handling, 167 permanent (see COMMITs) persistence and, 183-193 RMI, no built-in support for, 117 tracking changes to, 167-169, 185 visibility issues, 70 TRANSACTION_SERIALIZABLE, 71 tree components, Swing support for, 215 TreeModel class, 208 three-tier database application, 215 TreeNode implementations, 215 Trifox, Inc., 33 two-phase commits, 165 two-tier architecture, 129-133 fat-client systems, 131 limitations to, 131 object reuse, 132 using Java with, 130 when to use, 133 two-tier database applications, 210-215 type mapping system, JDBC 2.0, 77 TYPE_FORWARD_ONLY result set, 46 type-map object, 77 Types class, 50, 77, 291 TYPE_SCROLL_INSENSITIVE result set, 46, 69 TYPE_SCROLL_SENSITIVE result set, 46, 69 U[ Top ] UI delegates, Swing API, 208 monitoring models for changes, 219-221 UML diagrams, 127 component transactions, 186 composite pattern, 140 distributed listener pattern, 139 mid-tier business objects, 144 unencrypted passwords, 160 UnicastRemoteObject class, 111 providing custom socket factories, 164 Unicode, Java strings, 8 Unified Modeling Language (see UML diagrams) uniform resource locators (see URLs) unique identifiers, distributed components, 149-156, 170-172 unmarshaling, remote method calls, 112 updatable result sets (see result sets, updatable) UPDATE statement, 21 updateRow( ), 68 URLs, 29, 35 binding objects to, 109 RMI (Remote Method Invocation), 109 URL lookups, 111 using JDBC 2.0 Optional Package, 92 user interface, 207-223 accessibility issues, 9 banking application, 145 business objects and, 135 client patterns and, 138 V[ Top ] validation, component security, 161 VARBINARY datatype, 72 VARCHAR datatype, 44, 72 vendors, JDBC driver, 31-33 views (GUI widgets), 208 visibility of changes, updatable result sets, 69-71 Visigenic, 33 W[ Top ] warnings, JDBC, 51 wasNull( ), 41 WHERE clause, 21 Wittgenstein, Ludwig, xvi, 126, 183 worker threads, Swing API, 221-223 WorkerThread object, 221 X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
A[ Top ] aborting transactions (see ROLLBACKs) absolute( ), 48 AbstractTableModel class, 211 access, database (see databases, access) accessibility issues, user interface, 9 ActionEvent, 219 actionPerformed( ), 220 ActiveX technology, 7 Adabas D, 31 addBatch( ), 64 addPropertyChangeListener( ), 139 afterLast( ), 47-49 Agave Software Design, 31 Altera Software, 32 alternate type mapping, 77 Animation API, 8 APIs, Java, 6-8 application assembler, EJB, 118 application servers database security, 164 RMI, 114 three-tier architecture, 134 applications, database (see database applications) AppServer object, 113 architecture distributed application, 126-145 strategic vs. tactical thought, 127 three-tier (see three-tier architecture) two-tier client/server (see two-tier architecture) Array class, 75, 227-229 arrays, SQL, 75, 227-229 Asgard Software, 32 authenticate( ), 158 Authenticator interface, code examples, 157-160 auto-commit, 42, 186 turn off during batch processing, 65 turned off for distributed transactions, 99 B[ Top ] banking application, 143-145 authentication of clients, 157-161 business objects, 134 distributed components, 147-150 distributed listener pattern, 139 persistence issues, 144, 184 search mechanism, 171 UI component model, 215 BaseEntity class, 162, 168-170 persistence delegation, 194 Persistent interface implementation, 192 batch processing, 62-67 updatable result sets and, 67 BEA WebLogic, 8, 32 bean class methods, 121 bean-managed persistence, 124, 147 Beans API (see JavaBeans API) beans (see entity beans; session beans) beforeFirst( ), 48 Binary Large Object datatype (see BLOB) bind( ), 107 binding, object, 106, 109 binding parameters, 58 BLOB (Binary Large Object) datatype, 71-75 Blob class, 230 Borland International, Inc, 8 bridging technology, 30 Bulletproof Corporation, 8 business objects, 9 accessing, 170-172 application server and, 114 banking application, 144 mid-tier, 134-136 business patterns, 140-142 business rules, 134 business transactions and process-oriented components, 148 C[ Top ] caching component attributes, 173 CallableStatement class, 61, 231-234 batch processing, 64 Blob/Clob objects and, 73 when to use, 63 Caribou Lake Software, 32 case sensitivity, SQL keywords, 19 centralized data processing, 134 Centura Software, 32 Character Large Object datatype (see CLOB) Chomsky, Noam, xv, 25 classes, 126 Class.forName( ).newInstance( ), 36 connecting to databases, 37-39 for database access, 39 serializing, 114-116 support, 50 Class.forName( ).newInstance( ), 36 client patterns, 138 client/server architecture two-tier, 128-133 CLOB (Character Large Object) datatype, 71-75 Clob class, 234-236 close( ), 41 Cloudscape, Inc., 32 Codd, E.F., 16 code reuse, 132 collections and entity relationships, 181 Collections API, 77, 120, 181 column binding, 60 Commerce API, 7 commit( ), 170 JDBC transactions, 192 COMMITs, 23 auto-commit, 42, 186 Compaq, 32 component attributes, caching, 173 component model (JavaBeans), 116 component security (see security issues, components) composite pattern, 140 CONCUR_READ_ONLY concurrency type, 67 concurrency modes, 197 CONCUR_UPDATABLE concurrency type, 67 connecting to databases, 34-39 difficulty with, 35 Connection class, 36, 236-242 auto-commit, 42, 186 connecting to databases, 37-39 DatabaseMetaData class and, 81, 242-247 connection pooling, 95, 195, 296, 298 ConnectionEvent class, 293-295 ConnectionEventListener interface, 295 ConnectionPoolDataSource interface, 296 connectivity, database, 12, 133 container provider, EJB, 118 container-managed persistence, drawbacks of, 124, 147 contexts, JNDI, 107 controllers (GUI components), 208 CORBA (Common Object Request Broker Architecture), 108 Core API Java, 6 JDBC, 57-91, 227-292 CREATE statement, 20 create( ) EJB home interface and, 120-124 persistence delegate pattern and, 143 createStatement( ) scrollable result sets and, 46 cross-reference tables, 18 custom socket factories, 162 Cyber SQL Corporation, 8 D[ Top ] data access patterns, 142 data models, 18 data stores saving to/restoring from, 142, 185 three-tier architecture, 134 transaction management issues, 169 two-tier architecture, 131 data tables adding to, 20 creating, 20 cross-reference, 18 modifying, 21 removing data from, 21 database applications models for, 210-219 three-tier model, 215-219 two-tier model, 210-215 database engines, 12 database independence, 29 binary/character data and, 73 database servlet (example), 51-56 DatabaseMetaData class, 81, 242-247 databases access, 39-43 constructing a model for, 211-215 distributed transactions and, 99-101 home interface and, 170-172 via JNDI, 93, 106 concurrency modes, 197 connecting to, 34-39 difficulty with, 35 connectivity of, 12, 133 Java interaction with, 10 Java's advantages for, 12-14 modifying, 41-43 object, 11 object-relational, 11 relational, 11, 15-19 security issues, 164 URLs for, 29, 35 using JDBC 2.0 Optional Package, 92 DataRamp, Inc., 8 DataSource interface, 93, 297 DataTruncation class, 51 datatypes advanced, 71-79 Java and SQL, 44-46, 77 Date class, 51, 248 deadlocks, 170 default type mapping, 77 delegates (see persistence delegate pattern) DELETE command, 21 deleteRow( ), 69 Dennett, Daniel, xvi, 57 deployer, EJB, 118 Derrida, Jacques, xv, 3 Descartes, René, xv, 15 design patterns (see patterns, design) Dharma Systems Inc., 8 directory services, 93, 106 DataSource interface, 297 dirty reads, 70 dirty writes, 132 optimistic concurrency and, 197 DISTINCT type (SQL), 76 distributed application architecture, 126-145 distributed component model (EJB), 116 distributed components, 147-182 caching attributes, 173 entity relationships, 172-182 lookups/searches, 170-172 persistence issues, 183-206 persistent, 148-156 process-oriented, 148 security issues, 156-164, 167-169 transaction management of, 165-170 unique identifiers, 149-156 distributed computing issues for distributed listener pattern, 139 Java built-in support for, 9 distributed listener pattern, 139, 219-221 drawbacks to, 220 distributed transactions, 99-101 XAConnection interface, 314 doGet( ), 52 doPost( ), 55 double quotation marks ("), 19 Driver class, 36, 249-251 connecting to databases, 37 driver property information, 82 DriverManager class, 29, 36, 251-253 connecting to databases, 37 DriverPropertyInfo class, 82, 253-255 drivers bridging technology, 30 JDBC, 31-33 downloading, 30 scrollable result sets, handling, 49 mSQL-JDBC, 27, 30 property information, 82 registering, 36, 93 types, 30 E[ Top ] EJB (Enterprise JavaBeans), 116-125 application development roles, 118 bean class methods, 121 entity beans, 119-124 primary keys for, 121, 148 entity relationships, 172-181 façades, 173-181 finder methods, 120-124 home interface, 119-122, 170-172 JDBC and, 124 JNDI support in, 120 session beans, 119 shortcomings of, 146 transaction management, 165-170 vs. RMI, 116 (see also JavaBeans API) ejbCreate( ), 122 EJBObject class, 119 Embedded API, 7 encryption network communications, 162 password, 160 preventing access forgery, 161 end( ), 192 Ensodex, Inc., 32 Enterprise API, 7 Enterprise JavaBeans (see EJB) enterprise systems, 3-6 requirements for, 5 entities (database tables), 18 entity beans, 119-124 primary keys for, 121, 148 (see also persistent components) entity relationships, 172-181 EntityBean method, 121 Enumeration interface, 121, 217 event queues, Swing API, 209 long-lived events occurring in, 219 exception handling distributed transactions, 99 JDBC, 38, 50 remote method calls, 113 transactions, 167 execute( ), 80 executeBatch( ), 64 executeStatement( ), 87 executeUpdate( ), 40, 42 exporting objects, RMI, 111 F[ Top ] façades, 205 code example, 173-181 distributed listeners and, 220 factory pattern, 141 custom client socket factory, 163 fat clients, two-tier architecture, 131 find( ), 170 findByPrimaryKey( ), 121 finder methods (EJB), 120-124 first( ), 48 FormWeb, Inc., 32 G[ Top ] generate( ), 152 generateSequence( ), 152 getBlob( ), 72 getBundle( ), factory method, 141 getClob( ), 72 getColumnCount( ), 88 getColumnDisplaySize( ), 88 getColumnLabel( ), 88 getColumnType( ), 88 getConnection( ), 195 getDefault( ), factory method, 141 getFindSQL( ), 205 getLastUpdateID( ), 197 getLastUpdateTime( ), 197 getMetaData( ), 81 getPropertyInfo( ), 82 getResultSet( ), 80 getRow( ), 49 getString( ), 76 getTransactionIsolation( ), 71 getUpdateCounts( ), 65 getWarnings( ), 51 GIE Dyade, 32 GNU, 32 GUI (see user interface) Gupta Corporation, 8 GWE Technologies, 32 H[ Top ] Heidegger, Martin, xvi, 146 Hit Software, 32 HOB electronic GmbH & Co. KG, 32 home interface (EJB), 119-122, 170-172 Hughes Technologies, 27 I[ Top ] IBM, 8, 32 ID generation, 55 sequence generators and, 149-156 Identifier class, 161 identity tokens and authentication, 157, 160 IDL (Interface Definition Language), 7 IDS Software, 32 I-Kinetics, 32 Imaginary, 32 i-net software, 32 Information Builders, 32 Informix Corporation, 8, 32 init( ), 52 initial contexts, JNDI, 107 INSERT statement, 20 insertRow( ), 69 instances, reusing, 132 InterBase, 32 Interface Definition Language (IDL), 7 interfaces home/remote (EJB), 119-122 remote (RMI), 110 internationalization factory classes and, 141 Java built-in support, 8 requirement for enterprise systems, 5 InterSoft, 8, 32 Intersolv, 8, 32 invokeAndWait( ), 209 invokeLater( ), 209 invokeWorker( ), 223 isAfterLast( ), result set position, 49 isBeforeFirst( ), result set position, 49 isFirst( ), result set position, 49 isLast( ), result set position, 49 isolated database connectivity, 133 IteratorEnumeration class, 217 J[ Top ] Java APIs, 6-8 database programming with, 12-14 interacting with databases, 10 null vs. SQL NULL, 40 object types, 76 platform independence, 6-8 servlet example, 51-56 SQL datatypes, mapping, 44-46, 77 Java DataBase Connectivity (see JDBC) Java Naming and Directory Interface (see JNDI) Java Virtual Machine (JVM), 6 zero-install client concept, 12 JavaBeans API, 7 property change events and, 173 result sets and, 96-99 rowsets and, 96-99, 300-314 (see also EJB (Enterprise JavaBeans)) JAVA_OBJECT type, 77 Java-relational DBMS, 76 JavaSoft, 32 JDBC, 7 alternatives to, 33 API for, 10 Core API classes/interfaces, 227-292 DataSource interface, 93, 297 drivers, 31-33 downloading, 30 scrollable result sets, handling, 49 EJB methods and, 124 exception handling, 38 handling NULL values, 54 meta-data classes, 79-91 SQL terminal monitor application, 82-91 persistence operations, 195-206 prepared statements, 57-59 SQL arrays, 75, 227-229 stored procedures, 60-62 structure of, 27-30 support classes, 50 URLs, 29, 35 using JDBC 2.0 Optional Package, 92 vs. ODBC, 26, 34 warnings, 51 JDBC 2.0 features, 24 advanced datatype support, 71-79 batch processing, 62-67 datatype mappings, 45, 77 Optional Package, 92-101, 293-316 connection pooling, 95, 195 distributed transactions, 99-101 naming and directory services, 93, 106, 297 rowsets, 96-99, 300-314 scrollable result sets (see result sets, scrollable) updatable result sets (see result sets, updatable) jdbc.drivers property registering a driver, 36 JDBC-ODBC bridge, 26, 30 JNDI (Java Naming and Directory Interface), 105-108 connection pooling and, 95 contexts, 107 database access, 93, 106 object binding, 106 object lookup, 107, 171 support in EJB, 120 joins (SELECT statements), 22 JTable UI delegate, 210 JTree class, 208 avoiding data overload, 217-219 JVM (Java Virtual Machine), 6 distributed objects and, 108 zero-install client concept, 12 K[ Top ] Kant, Immanuel, xi, xv KonaSoft, Inc., 32 L[ Top ] last( ), 48 LDAP servers, 94 Liberty Integration Software, 32 listener pattern, 138 listeners, distributed (see distributed listener pattern) load( ), persistence delegate pattern and, 143 logical data models, 18 long-lived events executed by worker threads, 221-223 handling, 209 occurring in event queues, 219 lookup, objects EJB (Enterprise JavaBeans), 170-172 JNDI (Java Naming and Directory Interface), 107, 171 RMI (Remote Method Invocation), 117 Lotus Development, 32 M[ Top ] Management API, 7 marshaling, remote method calls, 112 Media API, 7 Media Frameworks API, 7 Memento class, 194 memento pattern, 143 separating business logic and persistence logic, 194 meta-data classes, JDBC, 79-91 SQL terminal monitor application, 82-91 mid-tier business objects, 134-136 model objects (GUI components), 208 event handling, 209-211 model-delegate pattern, 138, 208 models, database application, 210-219 model-view-controller (MVC) pattern, 138, 208 modification state, 185 moveToCurrentRow( ), 69 moveToInsertRow( ), 69 MsqlDataSource class, 94 mSQL-JDBC driver, 27 JDBC URL for, 30 multithreading, Swing API, 209 MVC (model-view-controller) pattern, 138, 208 N[ Top ] NAA (Network Application Architecture), 136 banking application, 143 Naming class, 111 naming services, 93, 106 DataSource interface, 297 Naming.rebind( ), 109 NetAway, 32 Network Application Architecture (NAA), 136 banking application, 143 network security, 162-164 next( ), 40, 47-49 Nietzsche, Friedrich, xvi, 92 node identifiers, ID generation, 149-152 nodes, root, 215-219 Nogginware Corporation, 33 nonremote objects, passing, 114-116 n-tier architecture (see three-tier architecture) null values, SQL NULL vs. Java null, 40 O[ Top ] object databases, 11 Object Design, 8 Object Management Group (OMG) IDL specification, 7 object serialization, 114-116 object servers, accessing remote objects, 109, 113 object-relational databases, 11 objects binding (JNDI), 106 exporting, 111 lookup EJB, 170-172 JNDI, 107, 171 RMI, 117 modification state of, 185 passing nonremote, 114-116 remote (see RMI) reuse of, 132 ODBC (Open DataBase Connectivity) vs. JDBC, 26, 34 ODBC-JDBC bridge, 26, 30 OMG (Object Management Group) IDL specification, 7 Open DataBase Connectivity (ODBC) vs. JDBC, 26, 34 Open Horizon, 8 OpenLink Software, 8, 33 optimistic concurrency mode, 197 Optional Package (see JDBC 2.0 features, Optional Package) Oracle Corporation, 8, 33 P[ Top ] parameters, binding, 58 passwords, unencrypted, 160 patterns, design, 137-143 business, 140-142 client, 138 composite, 140 data access, 142 distributed listener (see distributed listener pattern) factory, 141 custom client socket factory, 163 listener, 138 memento, 143, 194 model-delegate, 138, 208 model-view-controller (MVC), 138, 208 persistence delegate (see persistence delegate pattern) permanent transactions (see COMMITs) persistence, 183-206 banking application, 144 bean-managed, 124, 147 container-managed, drawbacks of, 124, 147 database transactions and, 183-193 impartiality needed for component model, 184 key behaviors of, 185 modification state, 185 of objects, 142, 185 RMI, no built-in support for, 117 search support, 197-206 separating business logic and persistence logic, 193 using design patterns, 194 persistence delegate pattern, 142 interface behaviors, 143 JDBC persistence, 196 search support, 197 separating business logic and persistence logic, 194 persistence library architecture of, 184 searching for objects using, 170 using JDBC classes, 195 Persistence Software, 8 PersistenceSupport interface, 194, 197 persistent components, 148-156 (see also entity beans) pessimistic concurrency mode, 197 phantom reads, 70 physical data models, 18 platform independence, Java, 6-8 polling threads, 221 PooledConnection interface, 298 pooling, connection, 95, 195, 296 portability date handling, 51 stored procedures and, 61 prepareCall( ), 61 prepared statements, 57-59 vs. stored procedures, 63 PreparedStatement class, 58, 255-258 batch processing, 64 Blob/Clob objects and, 73 when to use, 63 prepareStatement( ), 59 prepareUpdate( ), 168, 185 Presence Information Design, 8 previous( ), 47-49 primary keys, entity beans, 121, 148 printComments( ), 53 Pro-C Ltd., 8 process-oriented components, 148 (see also session beans) processResults( ), 87 methods used by, 88 properties file, for JDBC configuration, 37 PropertyChangeEvent, 173 distributed listeners and, 220 PropertyChangeListener, 220 PropertyChangeListener interface, 139 provider, EJB, 118 Q[ Top ] queries, 39-43 ResultSet class and, 40 subqueries, 22 (see also SELECT statement) query plans, building, 57-59 quotation marks, 19 R[ Top ] rebind( ), 109 Recital Corporation, 8, 33 reconnect( ), 173-181, 221 Ref class, 76, 259 REF type (SQL), 76 refreshRow( ), 71 registerOutParameter( ), 62 relational databases, 11, 15-19 object persistence and, 142 relative( ), 48 Remote interface, 110, 119 remote interfaces EJB (Enterprise JavaBeans), 119-122 RMI (Remote Method Invocation), 110 remote method calls marshaling/unmarshaling, 112 RemoteException, 113 skeletons/stubs, 112 Remote Method Invocation (see RMI) remote objects (see RMI) RemoteException, 113 remove( ), persistence delegate pattern and, 143 repeatable reads, 70 ResourceBundle class, 141 result set concurrency, 46, 67 result sets navigation of, 47-49 rowsets and, 96-99, 300-314 scrollable, 46-50 optimization of, 49 transaction isolation, 70 types, 46 updatable, 67-71 deleting values, 69 getting the latest data, 71 inserting new rows, 69 updating values, 68 using batch processing instead, 68 visibility of changes in, 69-71 ResultSet class, 259-273 queries and, 40 ResultSetMetaData class and, 79-81 rowsets and, 97 scrollable result sets, 46-50 ResultSetMetaData class, 79-81, 273-277 reuse of objects, 132 of source code, 132 RMI (Remote Method Invocation), 7 accessing remote objects, 13, 109, 113 application servers, 114 binding objects to URLs, 109 creating remote interfaces, 110 distributed computing support, 9 encrypting network communications, 162-164 exporting objects, 111 marshaling/unmarshaling, 112 object servers, 113 shortcomings of, 116 skeletons/stubs, 112 structure of, 108-113 vs. CORBA, 108 vs. EJB (Enterprise JavaBeans), 116 rmic (RMI compiler) command, 111 RogueWave Software, 8 rollback( ), 170 JDBC transactions, 193 ROLLBACKs, 23 mSQL and, 30 root nodes, 215-219 RootNode class (code example), 215-217 RowSet interface, 97-99, 300-306 constructing a model for database access, 211-215 RowSetEvent class, 306 RowSetInternal interface, 307 RowSetListener interface, 98, 308 RowSetMetaData interface, 309-312 RowSetReader interface, 313 rowsets, 96-99, 300-314 JavaBeans events, 98 RowSetWriter interface, 313 rules (see business rules) run( ), 209 S[ Top ] Sartre, Jean-Paul, xvi, 207 SAS Institute Inc., 8, 33 save( ), 220 SCO, 8, 33 scrollable result sets (see result sets, scrollable) SearchBinding class, 171 SearchCriteria class, 171, 205 searching for objects (see lookup, objects) using the persistence delegate, 197-206 secure socket layer (SSL) sockets, 162 Security API, 8 security issues components authentication, 156-161 identity tokens, 157, 160 unencrypted passwords, 160 validation, 161 databases, 164 distributed systems, 156-164, 167-169 networks, 162-164 RMI (Remote Method Invocation), 116 SELECT statement, 22, 39-43 (see also queries) sequence generators, ID generation, 149-156 SequenceGenerator class, code examples, 150-152, 153-156 Serializable interface, 115 serialization, object, 114-116 Server API, 8 server provider, EJB, 118 service providers, JNDI, 106 servlets, Java, 8 session beans, 119 (see also process-oriented components) SessionBean method, 121 setAutoCommit( ), 42 setBlob( ), 73 setClob( ), 73 setFetchDirection( ), 49 setFetchSize( ), 49 setString( ), 76 Simba Technologies, Inc., 33 single quotation marks ('), 19 skeletons and remote method calls, 112 Socket class, 162 sockets, 162-164 custom socket factories, 162 Software AG, 33 Solid Information Technology, 33 source code reuse, 132 special exception, remote methods, 113 SQL language, 10, 19-23 arrays, 75, 227-229 Java datatypes, mapping, 44-46, 77 NULL vs. Java null, 40 prepared statements, 57-59 SQL2, 23 datatype support, 44, 71 SQL3, 24 array objects, 227-229 datatype mappings, 45 datatype support, 76 structured types, 287 SQL/92, 23 stored procedures, 60-62 transaction logic, 23 VARCHAR datatype, 44 SQLData class, 277 SQLException class, 50 SQLInput class, 279 SQLJ paradigm, 34 SQLOutput class, 280-282 SQLWarning class, 51 SSL (secure socket layer) sockets, 162 StarQuest Software, 33 Statement class, 39, 282-287 batch processing, 64 execute( ) and, 80 PreparedStatement interface and, 58 when to use, 63 store( ), persistence delegate pattern and, 143, 196 stored procedures, 10, 60-62 vs. prepared statements, 63 Struct class, 76, 287 STRUCT type (SQL), 76 stubs and remote method calls, 112 subqueries, 22 Support class (full source code), 197-205 support classes, 50 Swing API, 138, 208-223 distributed listeners, 219-221 event queues, 209 handling long-lived events, 209 model-delegate architecture, 208 multithreading in, 209 MVC (model-view-controller), 208 three-tier database applications, 215-219 tree component support, 215 two-tier database application, 210-215 UI delegates, 208 monitoring models for changes, 219-221 worker threads, 221-223 SwingUtilities class, 209 Sybase, 8, 33 Symantec, 8, 33 system administrator, EJB, 118 T[ Top ] TableModel mode, 211 Telephony API, 8 ThinWeb SoftWare, 33 threads, Swing API, 209 three-tier architecture, 133-136 banking application, 143 centralized data processing, 134 data presentation, 135 drawbacks to, 136 Network Application Architecture, 136 three-tier database applications, 215-219 Thunderstone, 8 Time class, 51, 288 Timestamp class, 51, 289-291 tjFM, 33 /tmp/jdbc directory, 107 tokens, identity, 157, 160 Transaction class, 166-169 generic transaction logic (code example), 186-192 transaction isolation, 70 transaction management, 10 EJB (Enterprise JavaBeans), 165-170 TRANSACTION_NONE, 70 TRANSACTION_READ_COMMITTED, 70 TRANSACTION_READ_UNCOMMITTED, 70 TRANSACTION_REPEATABLE_READ, 71 transactions, 23 aborting (see ROLLBACKs) boundaries, 166 deadlocks, 170 distributed, 99-101 exception handling, 167 permanent (see COMMITs) persistence and, 183-193 RMI, no built-in support for, 117 tracking changes to, 167-169, 185 visibility issues, 70 TRANSACTION_SERIALIZABLE, 71 tree components, Swing support for, 215 TreeModel class, 208 three-tier database application, 215 TreeNode implementations, 215 Trifox, Inc., 33 two-phase commits, 165 two-tier architecture, 129-133 fat-client systems, 131 limitations to, 131 object reuse, 132 using Java with, 130 when to use, 133 two-tier database applications, 210-215 type mapping system, JDBC 2.0, 77 TYPE_FORWARD_ONLY result set, 46 type-map object, 77 Types class, 50, 77, 291 TYPE_SCROLL_INSENSITIVE result set, 46, 69 TYPE_SCROLL_SENSITIVE result set, 46, 69 U[ Top ] UI delegates, Swing API, 208 monitoring models for changes, 219-221 UML diagrams, 127 component transactions, 186 composite pattern, 140 distributed listener pattern, 139 mid-tier business objects, 144 unencrypted passwords, 160 UnicastRemoteObject class, 111 providing custom socket factories, 164 Unicode, Java strings, 8 Unified Modeling Language (see UML diagrams) uniform resource locators (see URLs) unique identifiers, distributed components, 149-156, 170-172 unmarshaling, remote method calls, 112 updatable result sets (see result sets, updatable) UPDATE statement, 21 updateRow( ), 68 URLs, 29, 35 binding objects to, 109 RMI (Remote Method Invocation), 109 URL lookups, 111 using JDBC 2.0 Optional Package, 92 user interface, 207-223 accessibility issues, 9 banking application, 145 business objects and, 135 client patterns and, 138 V[ Top ] validation, component security, 161 VARBINARY datatype, 72 VARCHAR datatype, 44, 72 vendors, JDBC driver, 31-33 views (GUI widgets), 208 visibility of changes, updatable result sets, 69-71 Visigenic, 33 W[ Top ] warnings, JDBC, 51 wasNull( ), 41 WHERE clause, 21 Wittgenstein, Ludwig, xvi, 126, 183 worker threads, Swing API, 221-223 WorkerThread object, 221 X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
B[ Top ] banking application, 143-145 authentication of clients, 157-161 business objects, 134 distributed components, 147-150 distributed listener pattern, 139 persistence issues, 144, 184 search mechanism, 171 UI component model, 215 BaseEntity class, 162, 168-170 persistence delegation, 194 Persistent interface implementation, 192 batch processing, 62-67 updatable result sets and, 67 BEA WebLogic, 8, 32 bean class methods, 121 bean-managed persistence, 124, 147 Beans API (see JavaBeans API) beans (see entity beans; session beans) beforeFirst( ), 48 Binary Large Object datatype (see BLOB) bind( ), 107 binding, object, 106, 109 binding parameters, 58 BLOB (Binary Large Object) datatype, 71-75 Blob class, 230 Borland International, Inc, 8 bridging technology, 30 Bulletproof Corporation, 8 business objects, 9 accessing, 170-172 application server and, 114 banking application, 144 mid-tier, 134-136 business patterns, 140-142 business rules, 134 business transactions and process-oriented components, 148 C[ Top ] caching component attributes, 173 CallableStatement class, 61, 231-234 batch processing, 64 Blob/Clob objects and, 73 when to use, 63 Caribou Lake Software, 32 case sensitivity, SQL keywords, 19 centralized data processing, 134 Centura Software, 32 Character Large Object datatype (see CLOB) Chomsky, Noam, xv, 25 classes, 126 Class.forName( ).newInstance( ), 36 connecting to databases, 37-39 for database access, 39 serializing, 114-116 support, 50 Class.forName( ).newInstance( ), 36 client patterns, 138 client/server architecture two-tier, 128-133 CLOB (Character Large Object) datatype, 71-75 Clob class, 234-236 close( ), 41 Cloudscape, Inc., 32 Codd, E.F., 16 code reuse, 132 collections and entity relationships, 181 Collections API, 77, 120, 181 column binding, 60 Commerce API, 7 commit( ), 170 JDBC transactions, 192 COMMITs, 23 auto-commit, 42, 186 Compaq, 32 component attributes, caching, 173 component model (JavaBeans), 116 component security (see security issues, components) composite pattern, 140 CONCUR_READ_ONLY concurrency type, 67 concurrency modes, 197 CONCUR_UPDATABLE concurrency type, 67 connecting to databases, 34-39 difficulty with, 35 Connection class, 36, 236-242 auto-commit, 42, 186 connecting to databases, 37-39 DatabaseMetaData class and, 81, 242-247 connection pooling, 95, 195, 296, 298 ConnectionEvent class, 293-295 ConnectionEventListener interface, 295 ConnectionPoolDataSource interface, 296 connectivity, database, 12, 133 container provider, EJB, 118 container-managed persistence, drawbacks of, 124, 147 contexts, JNDI, 107 controllers (GUI components), 208 CORBA (Common Object Request Broker Architecture), 108 Core API Java, 6 JDBC, 57-91, 227-292 CREATE statement, 20 create( ) EJB home interface and, 120-124 persistence delegate pattern and, 143 createStatement( ) scrollable result sets and, 46 cross-reference tables, 18 custom socket factories, 162 Cyber SQL Corporation, 8 D[ Top ] data access patterns, 142 data models, 18 data stores saving to/restoring from, 142, 185 three-tier architecture, 134 transaction management issues, 169 two-tier architecture, 131 data tables adding to, 20 creating, 20 cross-reference, 18 modifying, 21 removing data from, 21 database applications models for, 210-219 three-tier model, 215-219 two-tier model, 210-215 database engines, 12 database independence, 29 binary/character data and, 73 database servlet (example), 51-56 DatabaseMetaData class, 81, 242-247 databases access, 39-43 constructing a model for, 211-215 distributed transactions and, 99-101 home interface and, 170-172 via JNDI, 93, 106 concurrency modes, 197 connecting to, 34-39 difficulty with, 35 connectivity of, 12, 133 Java interaction with, 10 Java's advantages for, 12-14 modifying, 41-43 object, 11 object-relational, 11 relational, 11, 15-19 security issues, 164 URLs for, 29, 35 using JDBC 2.0 Optional Package, 92 DataRamp, Inc., 8 DataSource interface, 93, 297 DataTruncation class, 51 datatypes advanced, 71-79 Java and SQL, 44-46, 77 Date class, 51, 248 deadlocks, 170 default type mapping, 77 delegates (see persistence delegate pattern) DELETE command, 21 deleteRow( ), 69 Dennett, Daniel, xvi, 57 deployer, EJB, 118 Derrida, Jacques, xv, 3 Descartes, René, xv, 15 design patterns (see patterns, design) Dharma Systems Inc., 8 directory services, 93, 106 DataSource interface, 297 dirty reads, 70 dirty writes, 132 optimistic concurrency and, 197 DISTINCT type (SQL), 76 distributed application architecture, 126-145 distributed component model (EJB), 116 distributed components, 147-182 caching attributes, 173 entity relationships, 172-182 lookups/searches, 170-172 persistence issues, 183-206 persistent, 148-156 process-oriented, 148 security issues, 156-164, 167-169 transaction management of, 165-170 unique identifiers, 149-156 distributed computing issues for distributed listener pattern, 139 Java built-in support for, 9 distributed listener pattern, 139, 219-221 drawbacks to, 220 distributed transactions, 99-101 XAConnection interface, 314 doGet( ), 52 doPost( ), 55 double quotation marks ("), 19 Driver class, 36, 249-251 connecting to databases, 37 driver property information, 82 DriverManager class, 29, 36, 251-253 connecting to databases, 37 DriverPropertyInfo class, 82, 253-255 drivers bridging technology, 30 JDBC, 31-33 downloading, 30 scrollable result sets, handling, 49 mSQL-JDBC, 27, 30 property information, 82 registering, 36, 93 types, 30 E[ Top ] EJB (Enterprise JavaBeans), 116-125 application development roles, 118 bean class methods, 121 entity beans, 119-124 primary keys for, 121, 148 entity relationships, 172-181 façades, 173-181 finder methods, 120-124 home interface, 119-122, 170-172 JDBC and, 124 JNDI support in, 120 session beans, 119 shortcomings of, 146 transaction management, 165-170 vs. RMI, 116 (see also JavaBeans API) ejbCreate( ), 122 EJBObject class, 119 Embedded API, 7 encryption network communications, 162 password, 160 preventing access forgery, 161 end( ), 192 Ensodex, Inc., 32 Enterprise API, 7 Enterprise JavaBeans (see EJB) enterprise systems, 3-6 requirements for, 5 entities (database tables), 18 entity beans, 119-124 primary keys for, 121, 148 (see also persistent components) entity relationships, 172-181 EntityBean method, 121 Enumeration interface, 121, 217 event queues, Swing API, 209 long-lived events occurring in, 219 exception handling distributed transactions, 99 JDBC, 38, 50 remote method calls, 113 transactions, 167 execute( ), 80 executeBatch( ), 64 executeStatement( ), 87 executeUpdate( ), 40, 42 exporting objects, RMI, 111 F[ Top ] façades, 205 code example, 173-181 distributed listeners and, 220 factory pattern, 141 custom client socket factory, 163 fat clients, two-tier architecture, 131 find( ), 170 findByPrimaryKey( ), 121 finder methods (EJB), 120-124 first( ), 48 FormWeb, Inc., 32 G[ Top ] generate( ), 152 generateSequence( ), 152 getBlob( ), 72 getBundle( ), factory method, 141 getClob( ), 72 getColumnCount( ), 88 getColumnDisplaySize( ), 88 getColumnLabel( ), 88 getColumnType( ), 88 getConnection( ), 195 getDefault( ), factory method, 141 getFindSQL( ), 205 getLastUpdateID( ), 197 getLastUpdateTime( ), 197 getMetaData( ), 81 getPropertyInfo( ), 82 getResultSet( ), 80 getRow( ), 49 getString( ), 76 getTransactionIsolation( ), 71 getUpdateCounts( ), 65 getWarnings( ), 51 GIE Dyade, 32 GNU, 32 GUI (see user interface) Gupta Corporation, 8 GWE Technologies, 32 H[ Top ] Heidegger, Martin, xvi, 146 Hit Software, 32 HOB electronic GmbH & Co. KG, 32 home interface (EJB), 119-122, 170-172 Hughes Technologies, 27 I[ Top ] IBM, 8, 32 ID generation, 55 sequence generators and, 149-156 Identifier class, 161 identity tokens and authentication, 157, 160 IDL (Interface Definition Language), 7 IDS Software, 32 I-Kinetics, 32 Imaginary, 32 i-net software, 32 Information Builders, 32 Informix Corporation, 8, 32 init( ), 52 initial contexts, JNDI, 107 INSERT statement, 20 insertRow( ), 69 instances, reusing, 132 InterBase, 32 Interface Definition Language (IDL), 7 interfaces home/remote (EJB), 119-122 remote (RMI), 110 internationalization factory classes and, 141 Java built-in support, 8 requirement for enterprise systems, 5 InterSoft, 8, 32 Intersolv, 8, 32 invokeAndWait( ), 209 invokeLater( ), 209 invokeWorker( ), 223 isAfterLast( ), result set position, 49 isBeforeFirst( ), result set position, 49 isFirst( ), result set position, 49 isLast( ), result set position, 49 isolated database connectivity, 133 IteratorEnumeration class, 217 J[ Top ] Java APIs, 6-8 database programming with, 12-14 interacting with databases, 10 null vs. SQL NULL, 40 object types, 76 platform independence, 6-8 servlet example, 51-56 SQL datatypes, mapping, 44-46, 77 Java DataBase Connectivity (see JDBC) Java Naming and Directory Interface (see JNDI) Java Virtual Machine (JVM), 6 zero-install client concept, 12 JavaBeans API, 7 property change events and, 173 result sets and, 96-99 rowsets and, 96-99, 300-314 (see also EJB (Enterprise JavaBeans)) JAVA_OBJECT type, 77 Java-relational DBMS, 76 JavaSoft, 32 JDBC, 7 alternatives to, 33 API for, 10 Core API classes/interfaces, 227-292 DataSource interface, 93, 297 drivers, 31-33 downloading, 30 scrollable result sets, handling, 49 EJB methods and, 124 exception handling, 38 handling NULL values, 54 meta-data classes, 79-91 SQL terminal monitor application, 82-91 persistence operations, 195-206 prepared statements, 57-59 SQL arrays, 75, 227-229 stored procedures, 60-62 structure of, 27-30 support classes, 50 URLs, 29, 35 using JDBC 2.0 Optional Package, 92 vs. ODBC, 26, 34 warnings, 51 JDBC 2.0 features, 24 advanced datatype support, 71-79 batch processing, 62-67 datatype mappings, 45, 77 Optional Package, 92-101, 293-316 connection pooling, 95, 195 distributed transactions, 99-101 naming and directory services, 93, 106, 297 rowsets, 96-99, 300-314 scrollable result sets (see result sets, scrollable) updatable result sets (see result sets, updatable) jdbc.drivers property registering a driver, 36 JDBC-ODBC bridge, 26, 30 JNDI (Java Naming and Directory Interface), 105-108 connection pooling and, 95 contexts, 107 database access, 93, 106 object binding, 106 object lookup, 107, 171 support in EJB, 120 joins (SELECT statements), 22 JTable UI delegate, 210 JTree class, 208 avoiding data overload, 217-219 JVM (Java Virtual Machine), 6 distributed objects and, 108 zero-install client concept, 12 K[ Top ] Kant, Immanuel, xi, xv KonaSoft, Inc., 32 L[ Top ] last( ), 48 LDAP servers, 94 Liberty Integration Software, 32 listener pattern, 138 listeners, distributed (see distributed listener pattern) load( ), persistence delegate pattern and, 143 logical data models, 18 long-lived events executed by worker threads, 221-223 handling, 209 occurring in event queues, 219 lookup, objects EJB (Enterprise JavaBeans), 170-172 JNDI (Java Naming and Directory Interface), 107, 171 RMI (Remote Method Invocation), 117 Lotus Development, 32 M[ Top ] Management API, 7 marshaling, remote method calls, 112 Media API, 7 Media Frameworks API, 7 Memento class, 194 memento pattern, 143 separating business logic and persistence logic, 194 meta-data classes, JDBC, 79-91 SQL terminal monitor application, 82-91 mid-tier business objects, 134-136 model objects (GUI components), 208 event handling, 209-211 model-delegate pattern, 138, 208 models, database application, 210-219 model-view-controller (MVC) pattern, 138, 208 modification state, 185 moveToCurrentRow( ), 69 moveToInsertRow( ), 69 MsqlDataSource class, 94 mSQL-JDBC driver, 27 JDBC URL for, 30 multithreading, Swing API, 209 MVC (model-view-controller) pattern, 138, 208 N[ Top ] NAA (Network Application Architecture), 136 banking application, 143 Naming class, 111 naming services, 93, 106 DataSource interface, 297 Naming.rebind( ), 109 NetAway, 32 Network Application Architecture (NAA), 136 banking application, 143 network security, 162-164 next( ), 40, 47-49 Nietzsche, Friedrich, xvi, 92 node identifiers, ID generation, 149-152 nodes, root, 215-219 Nogginware Corporation, 33 nonremote objects, passing, 114-116 n-tier architecture (see three-tier architecture) null values, SQL NULL vs. Java null, 40 O[ Top ] object databases, 11 Object Design, 8 Object Management Group (OMG) IDL specification, 7 object serialization, 114-116 object servers, accessing remote objects, 109, 113 object-relational databases, 11 objects binding (JNDI), 106 exporting, 111 lookup EJB, 170-172 JNDI, 107, 171 RMI, 117 modification state of, 185 passing nonremote, 114-116 remote (see RMI) reuse of, 132 ODBC (Open DataBase Connectivity) vs. JDBC, 26, 34 ODBC-JDBC bridge, 26, 30 OMG (Object Management Group) IDL specification, 7 Open DataBase Connectivity (ODBC) vs. JDBC, 26, 34 Open Horizon, 8 OpenLink Software, 8, 33 optimistic concurrency mode, 197 Optional Package (see JDBC 2.0 features, Optional Package) Oracle Corporation, 8, 33 P[ Top ] parameters, binding, 58 passwords, unencrypted, 160 patterns, design, 137-143 business, 140-142 client, 138 composite, 140 data access, 142 distributed listener (see distributed listener pattern) factory, 141 custom client socket factory, 163 listener, 138 memento, 143, 194 model-delegate, 138, 208 model-view-controller (MVC), 138, 208 persistence delegate (see persistence delegate pattern) permanent transactions (see COMMITs) persistence, 183-206 banking application, 144 bean-managed, 124, 147 container-managed, drawbacks of, 124, 147 database transactions and, 183-193 impartiality needed for component model, 184 key behaviors of, 185 modification state, 185 of objects, 142, 185 RMI, no built-in support for, 117 search support, 197-206 separating business logic and persistence logic, 193 using design patterns, 194 persistence delegate pattern, 142 interface behaviors, 143 JDBC persistence, 196 search support, 197 separating business logic and persistence logic, 194 persistence library architecture of, 184 searching for objects using, 170 using JDBC classes, 195 Persistence Software, 8 PersistenceSupport interface, 194, 197 persistent components, 148-156 (see also entity beans) pessimistic concurrency mode, 197 phantom reads, 70 physical data models, 18 platform independence, Java, 6-8 polling threads, 221 PooledConnection interface, 298 pooling, connection, 95, 195, 296 portability date handling, 51 stored procedures and, 61 prepareCall( ), 61 prepared statements, 57-59 vs. stored procedures, 63 PreparedStatement class, 58, 255-258 batch processing, 64 Blob/Clob objects and, 73 when to use, 63 prepareStatement( ), 59 prepareUpdate( ), 168, 185 Presence Information Design, 8 previous( ), 47-49 primary keys, entity beans, 121, 148 printComments( ), 53 Pro-C Ltd., 8 process-oriented components, 148 (see also session beans) processResults( ), 87 methods used by, 88 properties file, for JDBC configuration, 37 PropertyChangeEvent, 173 distributed listeners and, 220 PropertyChangeListener, 220 PropertyChangeListener interface, 139 provider, EJB, 118 Q[ Top ] queries, 39-43 ResultSet class and, 40 subqueries, 22 (see also SELECT statement) query plans, building, 57-59 quotation marks, 19 R[ Top ] rebind( ), 109 Recital Corporation, 8, 33 reconnect( ), 173-181, 221 Ref class, 76, 259 REF type (SQL), 76 refreshRow( ), 71 registerOutParameter( ), 62 relational databases, 11, 15-19 object persistence and, 142 relative( ), 48 Remote interface, 110, 119 remote interfaces EJB (Enterprise JavaBeans), 119-122 RMI (Remote Method Invocation), 110 remote method calls marshaling/unmarshaling, 112 RemoteException, 113 skeletons/stubs, 112 Remote Method Invocation (see RMI) remote objects (see RMI) RemoteException, 113 remove( ), persistence delegate pattern and, 143 repeatable reads, 70 ResourceBundle class, 141 result set concurrency, 46, 67 result sets navigation of, 47-49 rowsets and, 96-99, 300-314 scrollable, 46-50 optimization of, 49 transaction isolation, 70 types, 46 updatable, 67-71 deleting values, 69 getting the latest data, 71 inserting new rows, 69 updating values, 68 using batch processing instead, 68 visibility of changes in, 69-71 ResultSet class, 259-273 queries and, 40 ResultSetMetaData class and, 79-81 rowsets and, 97 scrollable result sets, 46-50 ResultSetMetaData class, 79-81, 273-277 reuse of objects, 132 of source code, 132 RMI (Remote Method Invocation), 7 accessing remote objects, 13, 109, 113 application servers, 114 binding objects to URLs, 109 creating remote interfaces, 110 distributed computing support, 9 encrypting network communications, 162-164 exporting objects, 111 marshaling/unmarshaling, 112 object servers, 113 shortcomings of, 116 skeletons/stubs, 112 structure of, 108-113 vs. CORBA, 108 vs. EJB (Enterprise JavaBeans), 116 rmic (RMI compiler) command, 111 RogueWave Software, 8 rollback( ), 170 JDBC transactions, 193 ROLLBACKs, 23 mSQL and, 30 root nodes, 215-219 RootNode class (code example), 215-217 RowSet interface, 97-99, 300-306 constructing a model for database access, 211-215 RowSetEvent class, 306 RowSetInternal interface, 307 RowSetListener interface, 98, 308 RowSetMetaData interface, 309-312 RowSetReader interface, 313 rowsets, 96-99, 300-314 JavaBeans events, 98 RowSetWriter interface, 313 rules (see business rules) run( ), 209 S[ Top ] Sartre, Jean-Paul, xvi, 207 SAS Institute Inc., 8, 33 save( ), 220 SCO, 8, 33 scrollable result sets (see result sets, scrollable) SearchBinding class, 171 SearchCriteria class, 171, 205 searching for objects (see lookup, objects) using the persistence delegate, 197-206 secure socket layer (SSL) sockets, 162 Security API, 8 security issues components authentication, 156-161 identity tokens, 157, 160 unencrypted passwords, 160 validation, 161 databases, 164 distributed systems, 156-164, 167-169 networks, 162-164 RMI (Remote Method Invocation), 116 SELECT statement, 22, 39-43 (see also queries) sequence generators, ID generation, 149-156 SequenceGenerator class, code examples, 150-152, 153-156 Serializable interface, 115 serialization, object, 114-116 Server API, 8 server provider, EJB, 118 service providers, JNDI, 106 servlets, Java, 8 session beans, 119 (see also process-oriented components) SessionBean method, 121 setAutoCommit( ), 42 setBlob( ), 73 setClob( ), 73 setFetchDirection( ), 49 setFetchSize( ), 49 setString( ), 76 Simba Technologies, Inc., 33 single quotation marks ('), 19 skeletons and remote method calls, 112 Socket class, 162 sockets, 162-164 custom socket factories, 162 Software AG, 33 Solid Information Technology, 33 source code reuse, 132 special exception, remote methods, 113 SQL language, 10, 19-23 arrays, 75, 227-229 Java datatypes, mapping, 44-46, 77 NULL vs. Java null, 40 prepared statements, 57-59 SQL2, 23 datatype support, 44, 71 SQL3, 24 array objects, 227-229 datatype mappings, 45 datatype support, 76 structured types, 287 SQL/92, 23 stored procedures, 60-62 transaction logic, 23 VARCHAR datatype, 44 SQLData class, 277 SQLException class, 50 SQLInput class, 279 SQLJ paradigm, 34 SQLOutput class, 280-282 SQLWarning class, 51 SSL (secure socket layer) sockets, 162 StarQuest Software, 33 Statement class, 39, 282-287 batch processing, 64 execute( ) and, 80 PreparedStatement interface and, 58 when to use, 63 store( ), persistence delegate pattern and, 143, 196 stored procedures, 10, 60-62 vs. prepared statements, 63 Struct class, 76, 287 STRUCT type (SQL), 76 stubs and remote method calls, 112 subqueries, 22 Support class (full source code), 197-205 support classes, 50 Swing API, 138, 208-223 distributed listeners, 219-221 event queues, 209 handling long-lived events, 209 model-delegate architecture, 208 multithreading in, 209 MVC (model-view-controller), 208 three-tier database applications, 215-219 tree component support, 215 two-tier database application, 210-215 UI delegates, 208 monitoring models for changes, 219-221 worker threads, 221-223 SwingUtilities class, 209 Sybase, 8, 33 Symantec, 8, 33 system administrator, EJB, 118 T[ Top ] TableModel mode, 211 Telephony API, 8 ThinWeb SoftWare, 33 threads, Swing API, 209 three-tier architecture, 133-136 banking application, 143 centralized data processing, 134 data presentation, 135 drawbacks to, 136 Network Application Architecture, 136 three-tier database applications, 215-219 Thunderstone, 8 Time class, 51, 288 Timestamp class, 51, 289-291 tjFM, 33 /tmp/jdbc directory, 107 tokens, identity, 157, 160 Transaction class, 166-169 generic transaction logic (code example), 186-192 transaction isolation, 70 transaction management, 10 EJB (Enterprise JavaBeans), 165-170 TRANSACTION_NONE, 70 TRANSACTION_READ_COMMITTED, 70 TRANSACTION_READ_UNCOMMITTED, 70 TRANSACTION_REPEATABLE_READ, 71 transactions, 23 aborting (see ROLLBACKs) boundaries, 166 deadlocks, 170 distributed, 99-101 exception handling, 167 permanent (see COMMITs) persistence and, 183-193 RMI, no built-in support for, 117 tracking changes to, 167-169, 185 visibility issues, 70 TRANSACTION_SERIALIZABLE, 71 tree components, Swing support for, 215 TreeModel class, 208 three-tier database application, 215 TreeNode implementations, 215 Trifox, Inc., 33 two-phase commits, 165 two-tier architecture, 129-133 fat-client systems, 131 limitations to, 131 object reuse, 132 using Java with, 130 when to use, 133 two-tier database applications, 210-215 type mapping system, JDBC 2.0, 77 TYPE_FORWARD_ONLY result set, 46 type-map object, 77 Types class, 50, 77, 291 TYPE_SCROLL_INSENSITIVE result set, 46, 69 TYPE_SCROLL_SENSITIVE result set, 46, 69 U[ Top ] UI delegates, Swing API, 208 monitoring models for changes, 219-221 UML diagrams, 127 component transactions, 186 composite pattern, 140 distributed listener pattern, 139 mid-tier business objects, 144 unencrypted passwords, 160 UnicastRemoteObject class, 111 providing custom socket factories, 164 Unicode, Java strings, 8 Unified Modeling Language (see UML diagrams) uniform resource locators (see URLs) unique identifiers, distributed components, 149-156, 170-172 unmarshaling, remote method calls, 112 updatable result sets (see result sets, updatable) UPDATE statement, 21 updateRow( ), 68 URLs, 29, 35 binding objects to, 109 RMI (Remote Method Invocation), 109 URL lookups, 111 using JDBC 2.0 Optional Package, 92 user interface, 207-223 accessibility issues, 9 banking application, 145 business objects and, 135 client patterns and, 138 V[ Top ] validation, component security, 161 VARBINARY datatype, 72 VARCHAR datatype, 44, 72 vendors, JDBC driver, 31-33 views (GUI widgets), 208 visibility of changes, updatable result sets, 69-71 Visigenic, 33 W[ Top ] warnings, JDBC, 51 wasNull( ), 41 WHERE clause, 21 Wittgenstein, Ludwig, xvi, 126, 183 worker threads, Swing API, 221-223 WorkerThread object, 221 X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
C[ Top ] caching component attributes, 173 CallableStatement class, 61, 231-234 batch processing, 64 Blob/Clob objects and, 73 when to use, 63 Caribou Lake Software, 32 case sensitivity, SQL keywords, 19 centralized data processing, 134 Centura Software, 32 Character Large Object datatype (see CLOB) Chomsky, Noam, xv, 25 classes, 126 Class.forName( ).newInstance( ), 36 connecting to databases, 37-39 for database access, 39 serializing, 114-116 support, 50 Class.forName( ).newInstance( ), 36 client patterns, 138 client/server architecture two-tier, 128-133 CLOB (Character Large Object) datatype, 71-75 Clob class, 234-236 close( ), 41 Cloudscape, Inc., 32 Codd, E.F., 16 code reuse, 132 collections and entity relationships, 181 Collections API, 77, 120, 181 column binding, 60 Commerce API, 7 commit( ), 170 JDBC transactions, 192 COMMITs, 23 auto-commit, 42, 186 Compaq, 32 component attributes, caching, 173 component model (JavaBeans), 116 component security (see security issues, components) composite pattern, 140 CONCUR_READ_ONLY concurrency type, 67 concurrency modes, 197 CONCUR_UPDATABLE concurrency type, 67 connecting to databases, 34-39 difficulty with, 35 Connection class, 36, 236-242 auto-commit, 42, 186 connecting to databases, 37-39 DatabaseMetaData class and, 81, 242-247 connection pooling, 95, 195, 296, 298 ConnectionEvent class, 293-295 ConnectionEventListener interface, 295 ConnectionPoolDataSource interface, 296 connectivity, database, 12, 133 container provider, EJB, 118 container-managed persistence, drawbacks of, 124, 147 contexts, JNDI, 107 controllers (GUI components), 208 CORBA (Common Object Request Broker Architecture), 108 Core API Java, 6 JDBC, 57-91, 227-292 CREATE statement, 20 create( ) EJB home interface and, 120-124 persistence delegate pattern and, 143 createStatement( ) scrollable result sets and, 46 cross-reference tables, 18 custom socket factories, 162 Cyber SQL Corporation, 8 D[ Top ] data access patterns, 142 data models, 18 data stores saving to/restoring from, 142, 185 three-tier architecture, 134 transaction management issues, 169 two-tier architecture, 131 data tables adding to, 20 creating, 20 cross-reference, 18 modifying, 21 removing data from, 21 database applications models for, 210-219 three-tier model, 215-219 two-tier model, 210-215 database engines, 12 database independence, 29 binary/character data and, 73 database servlet (example), 51-56 DatabaseMetaData class, 81, 242-247 databases access, 39-43 constructing a model for, 211-215 distributed transactions and, 99-101 home interface and, 170-172 via JNDI, 93, 106 concurrency modes, 197 connecting to, 34-39 difficulty with, 35 connectivity of, 12, 133 Java interaction with, 10 Java's advantages for, 12-14 modifying, 41-43 object, 11 object-relational, 11 relational, 11, 15-19 security issues, 164 URLs for, 29, 35 using JDBC 2.0 Optional Package, 92 DataRamp, Inc., 8 DataSource interface, 93, 297 DataTruncation class, 51 datatypes advanced, 71-79 Java and SQL, 44-46, 77 Date class, 51, 248 deadlocks, 170 default type mapping, 77 delegates (see persistence delegate pattern) DELETE command, 21 deleteRow( ), 69 Dennett, Daniel, xvi, 57 deployer, EJB, 118 Derrida, Jacques, xv, 3 Descartes, René, xv, 15 design patterns (see patterns, design) Dharma Systems Inc., 8 directory services, 93, 106 DataSource interface, 297 dirty reads, 70 dirty writes, 132 optimistic concurrency and, 197 DISTINCT type (SQL), 76 distributed application architecture, 126-145 distributed component model (EJB), 116 distributed components, 147-182 caching attributes, 173 entity relationships, 172-182 lookups/searches, 170-172 persistence issues, 183-206 persistent, 148-156 process-oriented, 148 security issues, 156-164, 167-169 transaction management of, 165-170 unique identifiers, 149-156 distributed computing issues for distributed listener pattern, 139 Java built-in support for, 9 distributed listener pattern, 139, 219-221 drawbacks to, 220 distributed transactions, 99-101 XAConnection interface, 314 doGet( ), 52 doPost( ), 55 double quotation marks ("), 19 Driver class, 36, 249-251 connecting to databases, 37 driver property information, 82 DriverManager class, 29, 36, 251-253 connecting to databases, 37 DriverPropertyInfo class, 82, 253-255 drivers bridging technology, 30 JDBC, 31-33 downloading, 30 scrollable result sets, handling, 49 mSQL-JDBC, 27, 30 property information, 82 registering, 36, 93 types, 30 E[ Top ] EJB (Enterprise JavaBeans), 116-125 application development roles, 118 bean class methods, 121 entity beans, 119-124 primary keys for, 121, 148 entity relationships, 172-181 façades, 173-181 finder methods, 120-124 home interface, 119-122, 170-172 JDBC and, 124 JNDI support in, 120 session beans, 119 shortcomings of, 146 transaction management, 165-170 vs. RMI, 116 (see also JavaBeans API) ejbCreate( ), 122 EJBObject class, 119 Embedded API, 7 encryption network communications, 162 password, 160 preventing access forgery, 161 end( ), 192 Ensodex, Inc., 32 Enterprise API, 7 Enterprise JavaBeans (see EJB) enterprise systems, 3-6 requirements for, 5 entities (database tables), 18 entity beans, 119-124 primary keys for, 121, 148 (see also persistent components) entity relationships, 172-181 EntityBean method, 121 Enumeration interface, 121, 217 event queues, Swing API, 209 long-lived events occurring in, 219 exception handling distributed transactions, 99 JDBC, 38, 50 remote method calls, 113 transactions, 167 execute( ), 80 executeBatch( ), 64 executeStatement( ), 87 executeUpdate( ), 40, 42 exporting objects, RMI, 111 F[ Top ] façades, 205 code example, 173-181 distributed listeners and, 220 factory pattern, 141 custom client socket factory, 163 fat clients, two-tier architecture, 131 find( ), 170 findByPrimaryKey( ), 121 finder methods (EJB), 120-124 first( ), 48 FormWeb, Inc., 32 G[ Top ] generate( ), 152 generateSequence( ), 152 getBlob( ), 72 getBundle( ), factory method, 141 getClob( ), 72 getColumnCount( ), 88 getColumnDisplaySize( ), 88 getColumnLabel( ), 88 getColumnType( ), 88 getConnection( ), 195 getDefault( ), factory method, 141 getFindSQL( ), 205 getLastUpdateID( ), 197 getLastUpdateTime( ), 197 getMetaData( ), 81 getPropertyInfo( ), 82 getResultSet( ), 80 getRow( ), 49 getString( ), 76 getTransactionIsolation( ), 71 getUpdateCounts( ), 65 getWarnings( ), 51 GIE Dyade, 32 GNU, 32 GUI (see user interface) Gupta Corporation, 8 GWE Technologies, 32 H[ Top ] Heidegger, Martin, xvi, 146 Hit Software, 32 HOB electronic GmbH & Co. KG, 32 home interface (EJB), 119-122, 170-172 Hughes Technologies, 27 I[ Top ] IBM, 8, 32 ID generation, 55 sequence generators and, 149-156 Identifier class, 161 identity tokens and authentication, 157, 160 IDL (Interface Definition Language), 7 IDS Software, 32 I-Kinetics, 32 Imaginary, 32 i-net software, 32 Information Builders, 32 Informix Corporation, 8, 32 init( ), 52 initial contexts, JNDI, 107 INSERT statement, 20 insertRow( ), 69 instances, reusing, 132 InterBase, 32 Interface Definition Language (IDL), 7 interfaces home/remote (EJB), 119-122 remote (RMI), 110 internationalization factory classes and, 141 Java built-in support, 8 requirement for enterprise systems, 5 InterSoft, 8, 32 Intersolv, 8, 32 invokeAndWait( ), 209 invokeLater( ), 209 invokeWorker( ), 223 isAfterLast( ), result set position, 49 isBeforeFirst( ), result set position, 49 isFirst( ), result set position, 49 isLast( ), result set position, 49 isolated database connectivity, 133 IteratorEnumeration class, 217 J[ Top ] Java APIs, 6-8 database programming with, 12-14 interacting with databases, 10 null vs. SQL NULL, 40 object types, 76 platform independence, 6-8 servlet example, 51-56 SQL datatypes, mapping, 44-46, 77 Java DataBase Connectivity (see JDBC) Java Naming and Directory Interface (see JNDI) Java Virtual Machine (JVM), 6 zero-install client concept, 12 JavaBeans API, 7 property change events and, 173 result sets and, 96-99 rowsets and, 96-99, 300-314 (see also EJB (Enterprise JavaBeans)) JAVA_OBJECT type, 77 Java-relational DBMS, 76 JavaSoft, 32 JDBC, 7 alternatives to, 33 API for, 10 Core API classes/interfaces, 227-292 DataSource interface, 93, 297 drivers, 31-33 downloading, 30 scrollable result sets, handling, 49 EJB methods and, 124 exception handling, 38 handling NULL values, 54 meta-data classes, 79-91 SQL terminal monitor application, 82-91 persistence operations, 195-206 prepared statements, 57-59 SQL arrays, 75, 227-229 stored procedures, 60-62 structure of, 27-30 support classes, 50 URLs, 29, 35 using JDBC 2.0 Optional Package, 92 vs. ODBC, 26, 34 warnings, 51 JDBC 2.0 features, 24 advanced datatype support, 71-79 batch processing, 62-67 datatype mappings, 45, 77 Optional Package, 92-101, 293-316 connection pooling, 95, 195 distributed transactions, 99-101 naming and directory services, 93, 106, 297 rowsets, 96-99, 300-314 scrollable result sets (see result sets, scrollable) updatable result sets (see result sets, updatable) jdbc.drivers property registering a driver, 36 JDBC-ODBC bridge, 26, 30 JNDI (Java Naming and Directory Interface), 105-108 connection pooling and, 95 contexts, 107 database access, 93, 106 object binding, 106 object lookup, 107, 171 support in EJB, 120 joins (SELECT statements), 22 JTable UI delegate, 210 JTree class, 208 avoiding data overload, 217-219 JVM (Java Virtual Machine), 6 distributed objects and, 108 zero-install client concept, 12 K[ Top ] Kant, Immanuel, xi, xv KonaSoft, Inc., 32 L[ Top ] last( ), 48 LDAP servers, 94 Liberty Integration Software, 32 listener pattern, 138 listeners, distributed (see distributed listener pattern) load( ), persistence delegate pattern and, 143 logical data models, 18 long-lived events executed by worker threads, 221-223 handling, 209 occurring in event queues, 219 lookup, objects EJB (Enterprise JavaBeans), 170-172 JNDI (Java Naming and Directory Interface), 107, 171 RMI (Remote Method Invocation), 117 Lotus Development, 32 M[ Top ] Management API, 7 marshaling, remote method calls, 112 Media API, 7 Media Frameworks API, 7 Memento class, 194 memento pattern, 143 separating business logic and persistence logic, 194 meta-data classes, JDBC, 79-91 SQL terminal monitor application, 82-91 mid-tier business objects, 134-136 model objects (GUI components), 208 event handling, 209-211 model-delegate pattern, 138, 208 models, database application, 210-219 model-view-controller (MVC) pattern, 138, 208 modification state, 185 moveToCurrentRow( ), 69 moveToInsertRow( ), 69 MsqlDataSource class, 94 mSQL-JDBC driver, 27 JDBC URL for, 30 multithreading, Swing API, 209 MVC (model-view-controller) pattern, 138, 208 N[ Top ] NAA (Network Application Architecture), 136 banking application, 143 Naming class, 111 naming services, 93, 106 DataSource interface, 297 Naming.rebind( ), 109 NetAway, 32 Network Application Architecture (NAA), 136 banking application, 143 network security, 162-164 next( ), 40, 47-49 Nietzsche, Friedrich, xvi, 92 node identifiers, ID generation, 149-152 nodes, root, 215-219 Nogginware Corporation, 33 nonremote objects, passing, 114-116 n-tier architecture (see three-tier architecture) null values, SQL NULL vs. Java null, 40 O[ Top ] object databases, 11 Object Design, 8 Object Management Group (OMG) IDL specification, 7 object serialization, 114-116 object servers, accessing remote objects, 109, 113 object-relational databases, 11 objects binding (JNDI), 106 exporting, 111 lookup EJB, 170-172 JNDI, 107, 171 RMI, 117 modification state of, 185 passing nonremote, 114-116 remote (see RMI) reuse of, 132 ODBC (Open DataBase Connectivity) vs. JDBC, 26, 34 ODBC-JDBC bridge, 26, 30 OMG (Object Management Group) IDL specification, 7 Open DataBase Connectivity (ODBC) vs. JDBC, 26, 34 Open Horizon, 8 OpenLink Software, 8, 33 optimistic concurrency mode, 197 Optional Package (see JDBC 2.0 features, Optional Package) Oracle Corporation, 8, 33 P[ Top ] parameters, binding, 58 passwords, unencrypted, 160 patterns, design, 137-143 business, 140-142 client, 138 composite, 140 data access, 142 distributed listener (see distributed listener pattern) factory, 141 custom client socket factory, 163 listener, 138 memento, 143, 194 model-delegate, 138, 208 model-view-controller (MVC), 138, 208 persistence delegate (see persistence delegate pattern) permanent transactions (see COMMITs) persistence, 183-206 banking application, 144 bean-managed, 124, 147 container-managed, drawbacks of, 124, 147 database transactions and, 183-193 impartiality needed for component model, 184 key behaviors of, 185 modification state, 185 of objects, 142, 185 RMI, no built-in support for, 117 search support, 197-206 separating business logic and persistence logic, 193 using design patterns, 194 persistence delegate pattern, 142 interface behaviors, 143 JDBC persistence, 196 search support, 197 separating business logic and persistence logic, 194 persistence library architecture of, 184 searching for objects using, 170 using JDBC classes, 195 Persistence Software, 8 PersistenceSupport interface, 194, 197 persistent components, 148-156 (see also entity beans) pessimistic concurrency mode, 197 phantom reads, 70 physical data models, 18 platform independence, Java, 6-8 polling threads, 221 PooledConnection interface, 298 pooling, connection, 95, 195, 296 portability date handling, 51 stored procedures and, 61 prepareCall( ), 61 prepared statements, 57-59 vs. stored procedures, 63 PreparedStatement class, 58, 255-258 batch processing, 64 Blob/Clob objects and, 73 when to use, 63 prepareStatement( ), 59 prepareUpdate( ), 168, 185 Presence Information Design, 8 previous( ), 47-49 primary keys, entity beans, 121, 148 printComments( ), 53 Pro-C Ltd., 8 process-oriented components, 148 (see also session beans) processResults( ), 87 methods used by, 88 properties file, for JDBC configuration, 37 PropertyChangeEvent, 173 distributed listeners and, 220 PropertyChangeListener, 220 PropertyChangeListener interface, 139 provider, EJB, 118 Q[ Top ] queries, 39-43 ResultSet class and, 40 subqueries, 22 (see also SELECT statement) query plans, building, 57-59 quotation marks, 19 R[ Top ] rebind( ), 109 Recital Corporation, 8, 33 reconnect( ), 173-181, 221 Ref class, 76, 259 REF type (SQL), 76 refreshRow( ), 71 registerOutParameter( ), 62 relational databases, 11, 15-19 object persistence and, 142 relative( ), 48 Remote interface, 110, 119 remote interfaces EJB (Enterprise JavaBeans), 119-122 RMI (Remote Method Invocation), 110 remote method calls marshaling/unmarshaling, 112 RemoteException, 113 skeletons/stubs, 112 Remote Method Invocation (see RMI) remote objects (see RMI) RemoteException, 113 remove( ), persistence delegate pattern and, 143 repeatable reads, 70 ResourceBundle class, 141 result set concurrency, 46, 67 result sets navigation of, 47-49 rowsets and, 96-99, 300-314 scrollable, 46-50 optimization of, 49 transaction isolation, 70 types, 46 updatable, 67-71 deleting values, 69 getting the latest data, 71 inserting new rows, 69 updating values, 68 using batch processing instead, 68 visibility of changes in, 69-71 ResultSet class, 259-273 queries and, 40 ResultSetMetaData class and, 79-81 rowsets and, 97 scrollable result sets, 46-50 ResultSetMetaData class, 79-81, 273-277 reuse of objects, 132 of source code, 132 RMI (Remote Method Invocation), 7 accessing remote objects, 13, 109, 113 application servers, 114 binding objects to URLs, 109 creating remote interfaces, 110 distributed computing support, 9 encrypting network communications, 162-164 exporting objects, 111 marshaling/unmarshaling, 112 object servers, 113 shortcomings of, 116 skeletons/stubs, 112 structure of, 108-113 vs. CORBA, 108 vs. EJB (Enterprise JavaBeans), 116 rmic (RMI compiler) command, 111 RogueWave Software, 8 rollback( ), 170 JDBC transactions, 193 ROLLBACKs, 23 mSQL and, 30 root nodes, 215-219 RootNode class (code example), 215-217 RowSet interface, 97-99, 300-306 constructing a model for database access, 211-215 RowSetEvent class, 306 RowSetInternal interface, 307 RowSetListener interface, 98, 308 RowSetMetaData interface, 309-312 RowSetReader interface, 313 rowsets, 96-99, 300-314 JavaBeans events, 98 RowSetWriter interface, 313 rules (see business rules) run( ), 209 S[ Top ] Sartre, Jean-Paul, xvi, 207 SAS Institute Inc., 8, 33 save( ), 220 SCO, 8, 33 scrollable result sets (see result sets, scrollable) SearchBinding class, 171 SearchCriteria class, 171, 205 searching for objects (see lookup, objects) using the persistence delegate, 197-206 secure socket layer (SSL) sockets, 162 Security API, 8 security issues components authentication, 156-161 identity tokens, 157, 160 unencrypted passwords, 160 validation, 161 databases, 164 distributed systems, 156-164, 167-169 networks, 162-164 RMI (Remote Method Invocation), 116 SELECT statement, 22, 39-43 (see also queries) sequence generators, ID generation, 149-156 SequenceGenerator class, code examples, 150-152, 153-156 Serializable interface, 115 serialization, object, 114-116 Server API, 8 server provider, EJB, 118 service providers, JNDI, 106 servlets, Java, 8 session beans, 119 (see also process-oriented components) SessionBean method, 121 setAutoCommit( ), 42 setBlob( ), 73 setClob( ), 73 setFetchDirection( ), 49 setFetchSize( ), 49 setString( ), 76 Simba Technologies, Inc., 33 single quotation marks ('), 19 skeletons and remote method calls, 112 Socket class, 162 sockets, 162-164 custom socket factories, 162 Software AG, 33 Solid Information Technology, 33 source code reuse, 132 special exception, remote methods, 113 SQL language, 10, 19-23 arrays, 75, 227-229 Java datatypes, mapping, 44-46, 77 NULL vs. Java null, 40 prepared statements, 57-59 SQL2, 23 datatype support, 44, 71 SQL3, 24 array objects, 227-229 datatype mappings, 45 datatype support, 76 structured types, 287 SQL/92, 23 stored procedures, 60-62 transaction logic, 23 VARCHAR datatype, 44 SQLData class, 277 SQLException class, 50 SQLInput class, 279 SQLJ paradigm, 34 SQLOutput class, 280-282 SQLWarning class, 51 SSL (secure socket layer) sockets, 162 StarQuest Software, 33 Statement class, 39, 282-287 batch processing, 64 execute( ) and, 80 PreparedStatement interface and, 58 when to use, 63 store( ), persistence delegate pattern and, 143, 196 stored procedures, 10, 60-62 vs. prepared statements, 63 Struct class, 76, 287 STRUCT type (SQL), 76 stubs and remote method calls, 112 subqueries, 22 Support class (full source code), 197-205 support classes, 50 Swing API, 138, 208-223 distributed listeners, 219-221 event queues, 209 handling long-lived events, 209 model-delegate architecture, 208 multithreading in, 209 MVC (model-view-controller), 208 three-tier database applications, 215-219 tree component support, 215 two-tier database application, 210-215 UI delegates, 208 monitoring models for changes, 219-221 worker threads, 221-223 SwingUtilities class, 209 Sybase, 8, 33 Symantec, 8, 33 system administrator, EJB, 118 T[ Top ] TableModel mode, 211 Telephony API, 8 ThinWeb SoftWare, 33 threads, Swing API, 209 three-tier architecture, 133-136 banking application, 143 centralized data processing, 134 data presentation, 135 drawbacks to, 136 Network Application Architecture, 136 three-tier database applications, 215-219 Thunderstone, 8 Time class, 51, 288 Timestamp class, 51, 289-291 tjFM, 33 /tmp/jdbc directory, 107 tokens, identity, 157, 160 Transaction class, 166-169 generic transaction logic (code example), 186-192 transaction isolation, 70 transaction management, 10 EJB (Enterprise JavaBeans), 165-170 TRANSACTION_NONE, 70 TRANSACTION_READ_COMMITTED, 70 TRANSACTION_READ_UNCOMMITTED, 70 TRANSACTION_REPEATABLE_READ, 71 transactions, 23 aborting (see ROLLBACKs) boundaries, 166 deadlocks, 170 distributed, 99-101 exception handling, 167 permanent (see COMMITs) persistence and, 183-193 RMI, no built-in support for, 117 tracking changes to, 167-169, 185 visibility issues, 70 TRANSACTION_SERIALIZABLE, 71 tree components, Swing support for, 215 TreeModel class, 208 three-tier database application, 215 TreeNode implementations, 215 Trifox, Inc., 33 two-phase commits, 165 two-tier architecture, 129-133 fat-client systems, 131 limitations to, 131 object reuse, 132 using Java with, 130 when to use, 133 two-tier database applications, 210-215 type mapping system, JDBC 2.0, 77 TYPE_FORWARD_ONLY result set, 46 type-map object, 77 Types class, 50, 77, 291 TYPE_SCROLL_INSENSITIVE result set, 46, 69 TYPE_SCROLL_SENSITIVE result set, 46, 69 U[ Top ] UI delegates, Swing API, 208 monitoring models for changes, 219-221 UML diagrams, 127 component transactions, 186 composite pattern, 140 distributed listener pattern, 139 mid-tier business objects, 144 unencrypted passwords, 160 UnicastRemoteObject class, 111 providing custom socket factories, 164 Unicode, Java strings, 8 Unified Modeling Language (see UML diagrams) uniform resource locators (see URLs) unique identifiers, distributed components, 149-156, 170-172 unmarshaling, remote method calls, 112 updatable result sets (see result sets, updatable) UPDATE statement, 21 updateRow( ), 68 URLs, 29, 35 binding objects to, 109 RMI (Remote Method Invocation), 109 URL lookups, 111 using JDBC 2.0 Optional Package, 92 user interface, 207-223 accessibility issues, 9 banking application, 145 business objects and, 135 client patterns and, 138 V[ Top ] validation, component security, 161 VARBINARY datatype, 72 VARCHAR datatype, 44, 72 vendors, JDBC driver, 31-33 views (GUI widgets), 208 visibility of changes, updatable result sets, 69-71 Visigenic, 33 W[ Top ] warnings, JDBC, 51 wasNull( ), 41 WHERE clause, 21 Wittgenstein, Ludwig, xvi, 126, 183 worker threads, Swing API, 221-223 WorkerThread object, 221 X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
D[ Top ] data access patterns, 142 data models, 18 data stores saving to/restoring from, 142, 185 three-tier architecture, 134 transaction management issues, 169 two-tier architecture, 131 data tables adding to, 20 creating, 20 cross-reference, 18 modifying, 21 removing data from, 21 database applications models for, 210-219 three-tier model, 215-219 two-tier model, 210-215 database engines, 12 database independence, 29 binary/character data and, 73 database servlet (example), 51-56 DatabaseMetaData class, 81, 242-247 databases access, 39-43 constructing a model for, 211-215 distributed transactions and, 99-101 home interface and, 170-172 via JNDI, 93, 106 concurrency modes, 197 connecting to, 34-39 difficulty with, 35 connectivity of, 12, 133 Java interaction with, 10 Java's advantages for, 12-14 modifying, 41-43 object, 11 object-relational, 11 relational, 11, 15-19 security issues, 164 URLs for, 29, 35 using JDBC 2.0 Optional Package, 92 DataRamp, Inc., 8 DataSource interface, 93, 297 DataTruncation class, 51 datatypes advanced, 71-79 Java and SQL, 44-46, 77 Date class, 51, 248 deadlocks, 170 default type mapping, 77 delegates (see persistence delegate pattern) DELETE command, 21 deleteRow( ), 69 Dennett, Daniel, xvi, 57 deployer, EJB, 118 Derrida, Jacques, xv, 3 Descartes, René, xv, 15 design patterns (see patterns, design) Dharma Systems Inc., 8 directory services, 93, 106 DataSource interface, 297 dirty reads, 70 dirty writes, 132 optimistic concurrency and, 197 DISTINCT type (SQL), 76 distributed application architecture, 126-145 distributed component model (EJB), 116 distributed components, 147-182 caching attributes, 173 entity relationships, 172-182 lookups/searches, 170-172 persistence issues, 183-206 persistent, 148-156 process-oriented, 148 security issues, 156-164, 167-169 transaction management of, 165-170 unique identifiers, 149-156 distributed computing issues for distributed listener pattern, 139 Java built-in support for, 9 distributed listener pattern, 139, 219-221 drawbacks to, 220 distributed transactions, 99-101 XAConnection interface, 314 doGet( ), 52 doPost( ), 55 double quotation marks ("), 19 Driver class, 36, 249-251 connecting to databases, 37 driver property information, 82 DriverManager class, 29, 36, 251-253 connecting to databases, 37 DriverPropertyInfo class, 82, 253-255 drivers bridging technology, 30 JDBC, 31-33 downloading, 30 scrollable result sets, handling, 49 mSQL-JDBC, 27, 30 property information, 82 registering, 36, 93 types, 30 E[ Top ] EJB (Enterprise JavaBeans), 116-125 application development roles, 118 bean class methods, 121 entity beans, 119-124 primary keys for, 121, 148 entity relationships, 172-181 façades, 173-181 finder methods, 120-124 home interface, 119-122, 170-172 JDBC and, 124 JNDI support in, 120 session beans, 119 shortcomings of, 146 transaction management, 165-170 vs. RMI, 116 (see also JavaBeans API) ejbCreate( ), 122 EJBObject class, 119 Embedded API, 7 encryption network communications, 162 password, 160 preventing access forgery, 161 end( ), 192 Ensodex, Inc., 32 Enterprise API, 7 Enterprise JavaBeans (see EJB) enterprise systems, 3-6 requirements for, 5 entities (database tables), 18 entity beans, 119-124 primary keys for, 121, 148 (see also persistent components) entity relationships, 172-181 EntityBean method, 121 Enumeration interface, 121, 217 event queues, Swing API, 209 long-lived events occurring in, 219 exception handling distributed transactions, 99 JDBC, 38, 50 remote method calls, 113 transactions, 167 execute( ), 80 executeBatch( ), 64 executeStatement( ), 87 executeUpdate( ), 40, 42 exporting objects, RMI, 111 F[ Top ] façades, 205 code example, 173-181 distributed listeners and, 220 factory pattern, 141 custom client socket factory, 163 fat clients, two-tier architecture, 131 find( ), 170 findByPrimaryKey( ), 121 finder methods (EJB), 120-124 first( ), 48 FormWeb, Inc., 32 G[ Top ] generate( ), 152 generateSequence( ), 152 getBlob( ), 72 getBundle( ), factory method, 141 getClob( ), 72 getColumnCount( ), 88 getColumnDisplaySize( ), 88 getColumnLabel( ), 88 getColumnType( ), 88 getConnection( ), 195 getDefault( ), factory method, 141 getFindSQL( ), 205 getLastUpdateID( ), 197 getLastUpdateTime( ), 197 getMetaData( ), 81 getPropertyInfo( ), 82 getResultSet( ), 80 getRow( ), 49 getString( ), 76 getTransactionIsolation( ), 71 getUpdateCounts( ), 65 getWarnings( ), 51 GIE Dyade, 32 GNU, 32 GUI (see user interface) Gupta Corporation, 8 GWE Technologies, 32 H[ Top ] Heidegger, Martin, xvi, 146 Hit Software, 32 HOB electronic GmbH & Co. KG, 32 home interface (EJB), 119-122, 170-172 Hughes Technologies, 27 I[ Top ] IBM, 8, 32 ID generation, 55 sequence generators and, 149-156 Identifier class, 161 identity tokens and authentication, 157, 160 IDL (Interface Definition Language), 7 IDS Software, 32 I-Kinetics, 32 Imaginary, 32 i-net software, 32 Information Builders, 32 Informix Corporation, 8, 32 init( ), 52 initial contexts, JNDI, 107 INSERT statement, 20 insertRow( ), 69 instances, reusing, 132 InterBase, 32 Interface Definition Language (IDL), 7 interfaces home/remote (EJB), 119-122 remote (RMI), 110 internationalization factory classes and, 141 Java built-in support, 8 requirement for enterprise systems, 5 InterSoft, 8, 32 Intersolv, 8, 32 invokeAndWait( ), 209 invokeLater( ), 209 invokeWorker( ), 223 isAfterLast( ), result set position, 49 isBeforeFirst( ), result set position, 49 isFirst( ), result set position, 49 isLast( ), result set position, 49 isolated database connectivity, 133 IteratorEnumeration class, 217 J[ Top ] Java APIs, 6-8 database programming with, 12-14 interacting with databases, 10 null vs. SQL NULL, 40 object types, 76 platform independence, 6-8 servlet example, 51-56 SQL datatypes, mapping, 44-46, 77 Java DataBase Connectivity (see JDBC) Java Naming and Directory Interface (see JNDI) Java Virtual Machine (JVM), 6 zero-install client concept, 12 JavaBeans API, 7 property change events and, 173 result sets and, 96-99 rowsets and, 96-99, 300-314 (see also EJB (Enterprise JavaBeans)) JAVA_OBJECT type, 77 Java-relational DBMS, 76 JavaSoft, 32 JDBC, 7 alternatives to, 33 API for, 10 Core API classes/interfaces, 227-292 DataSource interface, 93, 297 drivers, 31-33 downloading, 30 scrollable result sets, handling, 49 EJB methods and, 124 exception handling, 38 handling NULL values, 54 meta-data classes, 79-91 SQL terminal monitor application, 82-91 persistence operations, 195-206 prepared statements, 57-59 SQL arrays, 75, 227-229 stored procedures, 60-62 structure of, 27-30 support classes, 50 URLs, 29, 35 using JDBC 2.0 Optional Package, 92 vs. ODBC, 26, 34 warnings, 51 JDBC 2.0 features, 24 advanced datatype support, 71-79 batch processing, 62-67 datatype mappings, 45, 77 Optional Package, 92-101, 293-316 connection pooling, 95, 195 distributed transactions, 99-101 naming and directory services, 93, 106, 297 rowsets, 96-99, 300-314 scrollable result sets (see result sets, scrollable) updatable result sets (see result sets, updatable) jdbc.drivers property registering a driver, 36 JDBC-ODBC bridge, 26, 30 JNDI (Java Naming and Directory Interface), 105-108 connection pooling and, 95 contexts, 107 database access, 93, 106 object binding, 106 object lookup, 107, 171 support in EJB, 120 joins (SELECT statements), 22 JTable UI delegate, 210 JTree class, 208 avoiding data overload, 217-219 JVM (Java Virtual Machine), 6 distributed objects and, 108 zero-install client concept, 12 K[ Top ] Kant, Immanuel, xi, xv KonaSoft, Inc., 32 L[ Top ] last( ), 48 LDAP servers, 94 Liberty Integration Software, 32 listener pattern, 138 listeners, distributed (see distributed listener pattern) load( ), persistence delegate pattern and, 143 logical data models, 18 long-lived events executed by worker threads, 221-223 handling, 209 occurring in event queues, 219 lookup, objects EJB (Enterprise JavaBeans), 170-172 JNDI (Java Naming and Directory Interface), 107, 171 RMI (Remote Method Invocation), 117 Lotus Development, 32 M[ Top ] Management API, 7 marshaling, remote method calls, 112 Media API, 7 Media Frameworks API, 7 Memento class, 194 memento pattern, 143 separating business logic and persistence logic, 194 meta-data classes, JDBC, 79-91 SQL terminal monitor application, 82-91 mid-tier business objects, 134-136 model objects (GUI components), 208 event handling, 209-211 model-delegate pattern, 138, 208 models, database application, 210-219 model-view-controller (MVC) pattern, 138, 208 modification state, 185 moveToCurrentRow( ), 69 moveToInsertRow( ), 69 MsqlDataSource class, 94 mSQL-JDBC driver, 27 JDBC URL for, 30 multithreading, Swing API, 209 MVC (model-view-controller) pattern, 138, 208 N[ Top ] NAA (Network Application Architecture), 136 banking application, 143 Naming class, 111 naming services, 93, 106 DataSource interface, 297 Naming.rebind( ), 109 NetAway, 32 Network Application Architecture (NAA), 136 banking application, 143 network security, 162-164 next( ), 40, 47-49 Nietzsche, Friedrich, xvi, 92 node identifiers, ID generation, 149-152 nodes, root, 215-219 Nogginware Corporation, 33 nonremote objects, passing, 114-116 n-tier architecture (see three-tier architecture) null values, SQL NULL vs. Java null, 40 O[ Top ] object databases, 11 Object Design, 8 Object Management Group (OMG) IDL specification, 7 object serialization, 114-116 object servers, accessing remote objects, 109, 113 object-relational databases, 11 objects binding (JNDI), 106 exporting, 111 lookup EJB, 170-172 JNDI, 107, 171 RMI, 117 modification state of, 185 passing nonremote, 114-116 remote (see RMI) reuse of, 132 ODBC (Open DataBase Connectivity) vs. JDBC, 26, 34 ODBC-JDBC bridge, 26, 30 OMG (Object Management Group) IDL specification, 7 Open DataBase Connectivity (ODBC) vs. JDBC, 26, 34 Open Horizon, 8 OpenLink Software, 8, 33 optimistic concurrency mode, 197 Optional Package (see JDBC 2.0 features, Optional Package) Oracle Corporation, 8, 33 P[ Top ] parameters, binding, 58 passwords, unencrypted, 160 patterns, design, 137-143 business, 140-142 client, 138 composite, 140 data access, 142 distributed listener (see distributed listener pattern) factory, 141 custom client socket factory, 163 listener, 138 memento, 143, 194 model-delegate, 138, 208 model-view-controller (MVC), 138, 208 persistence delegate (see persistence delegate pattern) permanent transactions (see COMMITs) persistence, 183-206 banking application, 144 bean-managed, 124, 147 container-managed, drawbacks of, 124, 147 database transactions and, 183-193 impartiality needed for component model, 184 key behaviors of, 185 modification state, 185 of objects, 142, 185 RMI, no built-in support for, 117 search support, 197-206 separating business logic and persistence logic, 193 using design patterns, 194 persistence delegate pattern, 142 interface behaviors, 143 JDBC persistence, 196 search support, 197 separating business logic and persistence logic, 194 persistence library architecture of, 184 searching for objects using, 170 using JDBC classes, 195 Persistence Software, 8 PersistenceSupport interface, 194, 197 persistent components, 148-156 (see also entity beans) pessimistic concurrency mode, 197 phantom reads, 70 physical data models, 18 platform independence, Java, 6-8 polling threads, 221 PooledConnection interface, 298 pooling, connection, 95, 195, 296 portability date handling, 51 stored procedures and, 61 prepareCall( ), 61 prepared statements, 57-59 vs. stored procedures, 63 PreparedStatement class, 58, 255-258 batch processing, 64 Blob/Clob objects and, 73 when to use, 63 prepareStatement( ), 59 prepareUpdate( ), 168, 185 Presence Information Design, 8 previous( ), 47-49 primary keys, entity beans, 121, 148 printComments( ), 53 Pro-C Ltd., 8 process-oriented components, 148 (see also session beans) processResults( ), 87 methods used by, 88 properties file, for JDBC configuration, 37 PropertyChangeEvent, 173 distributed listeners and, 220 PropertyChangeListener, 220 PropertyChangeListener interface, 139 provider, EJB, 118 Q[ Top ] queries, 39-43 ResultSet class and, 40 subqueries, 22 (see also SELECT statement) query plans, building, 57-59 quotation marks, 19 R[ Top ] rebind( ), 109 Recital Corporation, 8, 33 reconnect( ), 173-181, 221 Ref class, 76, 259 REF type (SQL), 76 refreshRow( ), 71 registerOutParameter( ), 62 relational databases, 11, 15-19 object persistence and, 142 relative( ), 48 Remote interface, 110, 119 remote interfaces EJB (Enterprise JavaBeans), 119-122 RMI (Remote Method Invocation), 110 remote method calls marshaling/unmarshaling, 112 RemoteException, 113 skeletons/stubs, 112 Remote Method Invocation (see RMI) remote objects (see RMI) RemoteException, 113 remove( ), persistence delegate pattern and, 143 repeatable reads, 70 ResourceBundle class, 141 result set concurrency, 46, 67 result sets navigation of, 47-49 rowsets and, 96-99, 300-314 scrollable, 46-50 optimization of, 49 transaction isolation, 70 types, 46 updatable, 67-71 deleting values, 69 getting the latest data, 71 inserting new rows, 69 updating values, 68 using batch processing instead, 68 visibility of changes in, 69-71 ResultSet class, 259-273 queries and, 40 ResultSetMetaData class and, 79-81 rowsets and, 97 scrollable result sets, 46-50 ResultSetMetaData class, 79-81, 273-277 reuse of objects, 132 of source code, 132 RMI (Remote Method Invocation), 7 accessing remote objects, 13, 109, 113 application servers, 114 binding objects to URLs, 109 creating remote interfaces, 110 distributed computing support, 9 encrypting network communications, 162-164 exporting objects, 111 marshaling/unmarshaling, 112 object servers, 113 shortcomings of, 116 skeletons/stubs, 112 structure of, 108-113 vs. CORBA, 108 vs. EJB (Enterprise JavaBeans), 116 rmic (RMI compiler) command, 111 RogueWave Software, 8 rollback( ), 170 JDBC transactions, 193 ROLLBACKs, 23 mSQL and, 30 root nodes, 215-219 RootNode class (code example), 215-217 RowSet interface, 97-99, 300-306 constructing a model for database access, 211-215 RowSetEvent class, 306 RowSetInternal interface, 307 RowSetListener interface, 98, 308 RowSetMetaData interface, 309-312 RowSetReader interface, 313 rowsets, 96-99, 300-314 JavaBeans events, 98 RowSetWriter interface, 313 rules (see business rules) run( ), 209 S[ Top ] Sartre, Jean-Paul, xvi, 207 SAS Institute Inc., 8, 33 save( ), 220 SCO, 8, 33 scrollable result sets (see result sets, scrollable) SearchBinding class, 171 SearchCriteria class, 171, 205 searching for objects (see lookup, objects) using the persistence delegate, 197-206 secure socket layer (SSL) sockets, 162 Security API, 8 security issues components authentication, 156-161 identity tokens, 157, 160 unencrypted passwords, 160 validation, 161 databases, 164 distributed systems, 156-164, 167-169 networks, 162-164 RMI (Remote Method Invocation), 116 SELECT statement, 22, 39-43 (see also queries) sequence generators, ID generation, 149-156 SequenceGenerator class, code examples, 150-152, 153-156 Serializable interface, 115 serialization, object, 114-116 Server API, 8 server provider, EJB, 118 service providers, JNDI, 106 servlets, Java, 8 session beans, 119 (see also process-oriented components) SessionBean method, 121 setAutoCommit( ), 42 setBlob( ), 73 setClob( ), 73 setFetchDirection( ), 49 setFetchSize( ), 49 setString( ), 76 Simba Technologies, Inc., 33 single quotation marks ('), 19 skeletons and remote method calls, 112 Socket class, 162 sockets, 162-164 custom socket factories, 162 Software AG, 33 Solid Information Technology, 33 source code reuse, 132 special exception, remote methods, 113 SQL language, 10, 19-23 arrays, 75, 227-229 Java datatypes, mapping, 44-46, 77 NULL vs. Java null, 40 prepared statements, 57-59 SQL2, 23 datatype support, 44, 71 SQL3, 24 array objects, 227-229 datatype mappings, 45 datatype support, 76 structured types, 287 SQL/92, 23 stored procedures, 60-62 transaction logic, 23 VARCHAR datatype, 44 SQLData class, 277 SQLException class, 50 SQLInput class, 279 SQLJ paradigm, 34 SQLOutput class, 280-282 SQLWarning class, 51 SSL (secure socket layer) sockets, 162 StarQuest Software, 33 Statement class, 39, 282-287 batch processing, 64 execute( ) and, 80 PreparedStatement interface and, 58 when to use, 63 store( ), persistence delegate pattern and, 143, 196 stored procedures, 10, 60-62 vs. prepared statements, 63 Struct class, 76, 287 STRUCT type (SQL), 76 stubs and remote method calls, 112 subqueries, 22 Support class (full source code), 197-205 support classes, 50 Swing API, 138, 208-223 distributed listeners, 219-221 event queues, 209 handling long-lived events, 209 model-delegate architecture, 208 multithreading in, 209 MVC (model-view-controller), 208 three-tier database applications, 215-219 tree component support, 215 two-tier database application, 210-215 UI delegates, 208 monitoring models for changes, 219-221 worker threads, 221-223 SwingUtilities class, 209 Sybase, 8, 33 Symantec, 8, 33 system administrator, EJB, 118 T[ Top ] TableModel mode, 211 Telephony API, 8 ThinWeb SoftWare, 33 threads, Swing API, 209 three-tier architecture, 133-136 banking application, 143 centralized data processing, 134 data presentation, 135 drawbacks to, 136 Network Application Architecture, 136 three-tier database applications, 215-219 Thunderstone, 8 Time class, 51, 288 Timestamp class, 51, 289-291 tjFM, 33 /tmp/jdbc directory, 107 tokens, identity, 157, 160 Transaction class, 166-169 generic transaction logic (code example), 186-192 transaction isolation, 70 transaction management, 10 EJB (Enterprise JavaBeans), 165-170 TRANSACTION_NONE, 70 TRANSACTION_READ_COMMITTED, 70 TRANSACTION_READ_UNCOMMITTED, 70 TRANSACTION_REPEATABLE_READ, 71 transactions, 23 aborting (see ROLLBACKs) boundaries, 166 deadlocks, 170 distributed, 99-101 exception handling, 167 permanent (see COMMITs) persistence and, 183-193 RMI, no built-in support for, 117 tracking changes to, 167-169, 185 visibility issues, 70 TRANSACTION_SERIALIZABLE, 71 tree components, Swing support for, 215 TreeModel class, 208 three-tier database application, 215 TreeNode implementations, 215 Trifox, Inc., 33 two-phase commits, 165 two-tier architecture, 129-133 fat-client systems, 131 limitations to, 131 object reuse, 132 using Java with, 130 when to use, 133 two-tier database applications, 210-215 type mapping system, JDBC 2.0, 77 TYPE_FORWARD_ONLY result set, 46 type-map object, 77 Types class, 50, 77, 291 TYPE_SCROLL_INSENSITIVE result set, 46, 69 TYPE_SCROLL_SENSITIVE result set, 46, 69 U[ Top ] UI delegates, Swing API, 208 monitoring models for changes, 219-221 UML diagrams, 127 component transactions, 186 composite pattern, 140 distributed listener pattern, 139 mid-tier business objects, 144 unencrypted passwords, 160 UnicastRemoteObject class, 111 providing custom socket factories, 164 Unicode, Java strings, 8 Unified Modeling Language (see UML diagrams) uniform resource locators (see URLs) unique identifiers, distributed components, 149-156, 170-172 unmarshaling, remote method calls, 112 updatable result sets (see result sets, updatable) UPDATE statement, 21 updateRow( ), 68 URLs, 29, 35 binding objects to, 109 RMI (Remote Method Invocation), 109 URL lookups, 111 using JDBC 2.0 Optional Package, 92 user interface, 207-223 accessibility issues, 9 banking application, 145 business objects and, 135 client patterns and, 138 V[ Top ] validation, component security, 161 VARBINARY datatype, 72 VARCHAR datatype, 44, 72 vendors, JDBC driver, 31-33 views (GUI widgets), 208 visibility of changes, updatable result sets, 69-71 Visigenic, 33 W[ Top ] warnings, JDBC, 51 wasNull( ), 41 WHERE clause, 21 Wittgenstein, Ludwig, xvi, 126, 183 worker threads, Swing API, 221-223 WorkerThread object, 221 X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
E[ Top ] EJB (Enterprise JavaBeans), 116-125 application development roles, 118 bean class methods, 121 entity beans, 119-124 primary keys for, 121, 148 entity relationships, 172-181 façades, 173-181 finder methods, 120-124 home interface, 119-122, 170-172 JDBC and, 124 JNDI support in, 120 session beans, 119 shortcomings of, 146 transaction management, 165-170 vs. RMI, 116 (see also JavaBeans API) ejbCreate( ), 122 EJBObject class, 119 Embedded API, 7 encryption network communications, 162 password, 160 preventing access forgery, 161 end( ), 192 Ensodex, Inc., 32 Enterprise API, 7 Enterprise JavaBeans (see EJB) enterprise systems, 3-6 requirements for, 5 entities (database tables), 18 entity beans, 119-124 primary keys for, 121, 148 (see also persistent components) entity relationships, 172-181 EntityBean method, 121 Enumeration interface, 121, 217 event queues, Swing API, 209 long-lived events occurring in, 219 exception handling distributed transactions, 99 JDBC, 38, 50 remote method calls, 113 transactions, 167 execute( ), 80 executeBatch( ), 64 executeStatement( ), 87 executeUpdate( ), 40, 42 exporting objects, RMI, 111 F[ Top ] façades, 205 code example, 173-181 distributed listeners and, 220 factory pattern, 141 custom client socket factory, 163 fat clients, two-tier architecture, 131 find( ), 170 findByPrimaryKey( ), 121 finder methods (EJB), 120-124 first( ), 48 FormWeb, Inc., 32 G[ Top ] generate( ), 152 generateSequence( ), 152 getBlob( ), 72 getBundle( ), factory method, 141 getClob( ), 72 getColumnCount( ), 88 getColumnDisplaySize( ), 88 getColumnLabel( ), 88 getColumnType( ), 88 getConnection( ), 195 getDefault( ), factory method, 141 getFindSQL( ), 205 getLastUpdateID( ), 197 getLastUpdateTime( ), 197 getMetaData( ), 81 getPropertyInfo( ), 82 getResultSet( ), 80 getRow( ), 49 getString( ), 76 getTransactionIsolation( ), 71 getUpdateCounts( ), 65 getWarnings( ), 51 GIE Dyade, 32 GNU, 32 GUI (see user interface) Gupta Corporation, 8 GWE Technologies, 32 H[ Top ] Heidegger, Martin, xvi, 146 Hit Software, 32 HOB electronic GmbH & Co. KG, 32 home interface (EJB), 119-122, 170-172 Hughes Technologies, 27 I[ Top ] IBM, 8, 32 ID generation, 55 sequence generators and, 149-156 Identifier class, 161 identity tokens and authentication, 157, 160 IDL (Interface Definition Language), 7 IDS Software, 32 I-Kinetics, 32 Imaginary, 32 i-net software, 32 Information Builders, 32 Informix Corporation, 8, 32 init( ), 52 initial contexts, JNDI, 107 INSERT statement, 20 insertRow( ), 69 instances, reusing, 132 InterBase, 32 Interface Definition Language (IDL), 7 interfaces home/remote (EJB), 119-122 remote (RMI), 110 internationalization factory classes and, 141 Java built-in support, 8 requirement for enterprise systems, 5 InterSoft, 8, 32 Intersolv, 8, 32 invokeAndWait( ), 209 invokeLater( ), 209 invokeWorker( ), 223 isAfterLast( ), result set position, 49 isBeforeFirst( ), result set position, 49 isFirst( ), result set position, 49 isLast( ), result set position, 49 isolated database connectivity, 133 IteratorEnumeration class, 217 J[ Top ] Java APIs, 6-8 database programming with, 12-14 interacting with databases, 10 null vs. SQL NULL, 40 object types, 76 platform independence, 6-8 servlet example, 51-56 SQL datatypes, mapping, 44-46, 77 Java DataBase Connectivity (see JDBC) Java Naming and Directory Interface (see JNDI) Java Virtual Machine (JVM), 6 zero-install client concept, 12 JavaBeans API, 7 property change events and, 173 result sets and, 96-99 rowsets and, 96-99, 300-314 (see also EJB (Enterprise JavaBeans)) JAVA_OBJECT type, 77 Java-relational DBMS, 76 JavaSoft, 32 JDBC, 7 alternatives to, 33 API for, 10 Core API classes/interfaces, 227-292 DataSource interface, 93, 297 drivers, 31-33 downloading, 30 scrollable result sets, handling, 49 EJB methods and, 124 exception handling, 38 handling NULL values, 54 meta-data classes, 79-91 SQL terminal monitor application, 82-91 persistence operations, 195-206 prepared statements, 57-59 SQL arrays, 75, 227-229 stored procedures, 60-62 structure of, 27-30 support classes, 50 URLs, 29, 35 using JDBC 2.0 Optional Package, 92 vs. ODBC, 26, 34 warnings, 51 JDBC 2.0 features, 24 advanced datatype support, 71-79 batch processing, 62-67 datatype mappings, 45, 77 Optional Package, 92-101, 293-316 connection pooling, 95, 195 distributed transactions, 99-101 naming and directory services, 93, 106, 297 rowsets, 96-99, 300-314 scrollable result sets (see result sets, scrollable) updatable result sets (see result sets, updatable) jdbc.drivers property registering a driver, 36 JDBC-ODBC bridge, 26, 30 JNDI (Java Naming and Directory Interface), 105-108 connection pooling and, 95 contexts, 107 database access, 93, 106 object binding, 106 object lookup, 107, 171 support in EJB, 120 joins (SELECT statements), 22 JTable UI delegate, 210 JTree class, 208 avoiding data overload, 217-219 JVM (Java Virtual Machine), 6 distributed objects and, 108 zero-install client concept, 12 K[ Top ] Kant, Immanuel, xi, xv KonaSoft, Inc., 32 L[ Top ] last( ), 48 LDAP servers, 94 Liberty Integration Software, 32 listener pattern, 138 listeners, distributed (see distributed listener pattern) load( ), persistence delegate pattern and, 143 logical data models, 18 long-lived events executed by worker threads, 221-223 handling, 209 occurring in event queues, 219 lookup, objects EJB (Enterprise JavaBeans), 170-172 JNDI (Java Naming and Directory Interface), 107, 171 RMI (Remote Method Invocation), 117 Lotus Development, 32 M[ Top ] Management API, 7 marshaling, remote method calls, 112 Media API, 7 Media Frameworks API, 7 Memento class, 194 memento pattern, 143 separating business logic and persistence logic, 194 meta-data classes, JDBC, 79-91 SQL terminal monitor application, 82-91 mid-tier business objects, 134-136 model objects (GUI components), 208 event handling, 209-211 model-delegate pattern, 138, 208 models, database application, 210-219 model-view-controller (MVC) pattern, 138, 208 modification state, 185 moveToCurrentRow( ), 69 moveToInsertRow( ), 69 MsqlDataSource class, 94 mSQL-JDBC driver, 27 JDBC URL for, 30 multithreading, Swing API, 209 MVC (model-view-controller) pattern, 138, 208 N[ Top ] NAA (Network Application Architecture), 136 banking application, 143 Naming class, 111 naming services, 93, 106 DataSource interface, 297 Naming.rebind( ), 109 NetAway, 32 Network Application Architecture (NAA), 136 banking application, 143 network security, 162-164 next( ), 40, 47-49 Nietzsche, Friedrich, xvi, 92 node identifiers, ID generation, 149-152 nodes, root, 215-219 Nogginware Corporation, 33 nonremote objects, passing, 114-116 n-tier architecture (see three-tier architecture) null values, SQL NULL vs. Java null, 40 O[ Top ] object databases, 11 Object Design, 8 Object Management Group (OMG) IDL specification, 7 object serialization, 114-116 object servers, accessing remote objects, 109, 113 object-relational databases, 11 objects binding (JNDI), 106 exporting, 111 lookup EJB, 170-172 JNDI, 107, 171 RMI, 117 modification state of, 185 passing nonremote, 114-116 remote (see RMI) reuse of, 132 ODBC (Open DataBase Connectivity) vs. JDBC, 26, 34 ODBC-JDBC bridge, 26, 30 OMG (Object Management Group) IDL specification, 7 Open DataBase Connectivity (ODBC) vs. JDBC, 26, 34 Open Horizon, 8 OpenLink Software, 8, 33 optimistic concurrency mode, 197 Optional Package (see JDBC 2.0 features, Optional Package) Oracle Corporation, 8, 33 P[ Top ] parameters, binding, 58 passwords, unencrypted, 160 patterns, design, 137-143 business, 140-142 client, 138 composite, 140 data access, 142 distributed listener (see distributed listener pattern) factory, 141 custom client socket factory, 163 listener, 138 memento, 143, 194 model-delegate, 138, 208 model-view-controller (MVC), 138, 208 persistence delegate (see persistence delegate pattern) permanent transactions (see COMMITs) persistence, 183-206 banking application, 144 bean-managed, 124, 147 container-managed, drawbacks of, 124, 147 database transactions and, 183-193 impartiality needed for component model, 184 key behaviors of, 185 modification state, 185 of objects, 142, 185 RMI, no built-in support for, 117 search support, 197-206 separating business logic and persistence logic, 193 using design patterns, 194 persistence delegate pattern, 142 interface behaviors, 143 JDBC persistence, 196 search support, 197 separating business logic and persistence logic, 194 persistence library architecture of, 184 searching for objects using, 170 using JDBC classes, 195 Persistence Software, 8 PersistenceSupport interface, 194, 197 persistent components, 148-156 (see also entity beans) pessimistic concurrency mode, 197 phantom reads, 70 physical data models, 18 platform independence, Java, 6-8 polling threads, 221 PooledConnection interface, 298 pooling, connection, 95, 195, 296 portability date handling, 51 stored procedures and, 61 prepareCall( ), 61 prepared statements, 57-59 vs. stored procedures, 63 PreparedStatement class, 58, 255-258 batch processing, 64 Blob/Clob objects and, 73 when to use, 63 prepareStatement( ), 59 prepareUpdate( ), 168, 185 Presence Information Design, 8 previous( ), 47-49 primary keys, entity beans, 121, 148 printComments( ), 53 Pro-C Ltd., 8 process-oriented components, 148 (see also session beans) processResults( ), 87 methods used by, 88 properties file, for JDBC configuration, 37 PropertyChangeEvent, 173 distributed listeners and, 220 PropertyChangeListener, 220 PropertyChangeListener interface, 139 provider, EJB, 118 Q[ Top ] queries, 39-43 ResultSet class and, 40 subqueries, 22 (see also SELECT statement) query plans, building, 57-59 quotation marks, 19 R[ Top ] rebind( ), 109 Recital Corporation, 8, 33 reconnect( ), 173-181, 221 Ref class, 76, 259 REF type (SQL), 76 refreshRow( ), 71 registerOutParameter( ), 62 relational databases, 11, 15-19 object persistence and, 142 relative( ), 48 Remote interface, 110, 119 remote interfaces EJB (Enterprise JavaBeans), 119-122 RMI (Remote Method Invocation), 110 remote method calls marshaling/unmarshaling, 112 RemoteException, 113 skeletons/stubs, 112 Remote Method Invocation (see RMI) remote objects (see RMI) RemoteException, 113 remove( ), persistence delegate pattern and, 143 repeatable reads, 70 ResourceBundle class, 141 result set concurrency, 46, 67 result sets navigation of, 47-49 rowsets and, 96-99, 300-314 scrollable, 46-50 optimization of, 49 transaction isolation, 70 types, 46 updatable, 67-71 deleting values, 69 getting the latest data, 71 inserting new rows, 69 updating values, 68 using batch processing instead, 68 visibility of changes in, 69-71 ResultSet class, 259-273 queries and, 40 ResultSetMetaData class and, 79-81 rowsets and, 97 scrollable result sets, 46-50 ResultSetMetaData class, 79-81, 273-277 reuse of objects, 132 of source code, 132 RMI (Remote Method Invocation), 7 accessing remote objects, 13, 109, 113 application servers, 114 binding objects to URLs, 109 creating remote interfaces, 110 distributed computing support, 9 encrypting network communications, 162-164 exporting objects, 111 marshaling/unmarshaling, 112 object servers, 113 shortcomings of, 116 skeletons/stubs, 112 structure of, 108-113 vs. CORBA, 108 vs. EJB (Enterprise JavaBeans), 116 rmic (RMI compiler) command, 111 RogueWave Software, 8 rollback( ), 170 JDBC transactions, 193 ROLLBACKs, 23 mSQL and, 30 root nodes, 215-219 RootNode class (code example), 215-217 RowSet interface, 97-99, 300-306 constructing a model for database access, 211-215 RowSetEvent class, 306 RowSetInternal interface, 307 RowSetListener interface, 98, 308 RowSetMetaData interface, 309-312 RowSetReader interface, 313 rowsets, 96-99, 300-314 JavaBeans events, 98 RowSetWriter interface, 313 rules (see business rules) run( ), 209 S[ Top ] Sartre, Jean-Paul, xvi, 207 SAS Institute Inc., 8, 33 save( ), 220 SCO, 8, 33 scrollable result sets (see result sets, scrollable) SearchBinding class, 171 SearchCriteria class, 171, 205 searching for objects (see lookup, objects) using the persistence delegate, 197-206 secure socket layer (SSL) sockets, 162 Security API, 8 security issues components authentication, 156-161 identity tokens, 157, 160 unencrypted passwords, 160 validation, 161 databases, 164 distributed systems, 156-164, 167-169 networks, 162-164 RMI (Remote Method Invocation), 116 SELECT statement, 22, 39-43 (see also queries) sequence generators, ID generation, 149-156 SequenceGenerator class, code examples, 150-152, 153-156 Serializable interface, 115 serialization, object, 114-116 Server API, 8 server provider, EJB, 118 service providers, JNDI, 106 servlets, Java, 8 session beans, 119 (see also process-oriented components) SessionBean method, 121 setAutoCommit( ), 42 setBlob( ), 73 setClob( ), 73 setFetchDirection( ), 49 setFetchSize( ), 49 setString( ), 76 Simba Technologies, Inc., 33 single quotation marks ('), 19 skeletons and remote method calls, 112 Socket class, 162 sockets, 162-164 custom socket factories, 162 Software AG, 33 Solid Information Technology, 33 source code reuse, 132 special exception, remote methods, 113 SQL language, 10, 19-23 arrays, 75, 227-229 Java datatypes, mapping, 44-46, 77 NULL vs. Java null, 40 prepared statements, 57-59 SQL2, 23 datatype support, 44, 71 SQL3, 24 array objects, 227-229 datatype mappings, 45 datatype support, 76 structured types, 287 SQL/92, 23 stored procedures, 60-62 transaction logic, 23 VARCHAR datatype, 44 SQLData class, 277 SQLException class, 50 SQLInput class, 279 SQLJ paradigm, 34 SQLOutput class, 280-282 SQLWarning class, 51 SSL (secure socket layer) sockets, 162 StarQuest Software, 33 Statement class, 39, 282-287 batch processing, 64 execute( ) and, 80 PreparedStatement interface and, 58 when to use, 63 store( ), persistence delegate pattern and, 143, 196 stored procedures, 10, 60-62 vs. prepared statements, 63 Struct class, 76, 287 STRUCT type (SQL), 76 stubs and remote method calls, 112 subqueries, 22 Support class (full source code), 197-205 support classes, 50 Swing API, 138, 208-223 distributed listeners, 219-221 event queues, 209 handling long-lived events, 209 model-delegate architecture, 208 multithreading in, 209 MVC (model-view-controller), 208 three-tier database applications, 215-219 tree component support, 215 two-tier database application, 210-215 UI delegates, 208 monitoring models for changes, 219-221 worker threads, 221-223 SwingUtilities class, 209 Sybase, 8, 33 Symantec, 8, 33 system administrator, EJB, 118 T[ Top ] TableModel mode, 211 Telephony API, 8 ThinWeb SoftWare, 33 threads, Swing API, 209 three-tier architecture, 133-136 banking application, 143 centralized data processing, 134 data presentation, 135 drawbacks to, 136 Network Application Architecture, 136 three-tier database applications, 215-219 Thunderstone, 8 Time class, 51, 288 Timestamp class, 51, 289-291 tjFM, 33 /tmp/jdbc directory, 107 tokens, identity, 157, 160 Transaction class, 166-169 generic transaction logic (code example), 186-192 transaction isolation, 70 transaction management, 10 EJB (Enterprise JavaBeans), 165-170 TRANSACTION_NONE, 70 TRANSACTION_READ_COMMITTED, 70 TRANSACTION_READ_UNCOMMITTED, 70 TRANSACTION_REPEATABLE_READ, 71 transactions, 23 aborting (see ROLLBACKs) boundaries, 166 deadlocks, 170 distributed, 99-101 exception handling, 167 permanent (see COMMITs) persistence and, 183-193 RMI, no built-in support for, 117 tracking changes to, 167-169, 185 visibility issues, 70 TRANSACTION_SERIALIZABLE, 71 tree components, Swing support for, 215 TreeModel class, 208 three-tier database application, 215 TreeNode implementations, 215 Trifox, Inc., 33 two-phase commits, 165 two-tier architecture, 129-133 fat-client systems, 131 limitations to, 131 object reuse, 132 using Java with, 130 when to use, 133 two-tier database applications, 210-215 type mapping system, JDBC 2.0, 77 TYPE_FORWARD_ONLY result set, 46 type-map object, 77 Types class, 50, 77, 291 TYPE_SCROLL_INSENSITIVE result set, 46, 69 TYPE_SCROLL_SENSITIVE result set, 46, 69 U[ Top ] UI delegates, Swing API, 208 monitoring models for changes, 219-221 UML diagrams, 127 component transactions, 186 composite pattern, 140 distributed listener pattern, 139 mid-tier business objects, 144 unencrypted passwords, 160 UnicastRemoteObject class, 111 providing custom socket factories, 164 Unicode, Java strings, 8 Unified Modeling Language (see UML diagrams) uniform resource locators (see URLs) unique identifiers, distributed components, 149-156, 170-172 unmarshaling, remote method calls, 112 updatable result sets (see result sets, updatable) UPDATE statement, 21 updateRow( ), 68 URLs, 29, 35 binding objects to, 109 RMI (Remote Method Invocation), 109 URL lookups, 111 using JDBC 2.0 Optional Package, 92 user interface, 207-223 accessibility issues, 9 banking application, 145 business objects and, 135 client patterns and, 138 V[ Top ] validation, component security, 161 VARBINARY datatype, 72 VARCHAR datatype, 44, 72 vendors, JDBC driver, 31-33 views (GUI widgets), 208 visibility of changes, updatable result sets, 69-71 Visigenic, 33 W[ Top ] warnings, JDBC, 51 wasNull( ), 41 WHERE clause, 21 Wittgenstein, Ludwig, xvi, 126, 183 worker threads, Swing API, 221-223 WorkerThread object, 221 X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
F[ Top ] façades, 205 code example, 173-181 distributed listeners and, 220 factory pattern, 141 custom client socket factory, 163 fat clients, two-tier architecture, 131 find( ), 170 findByPrimaryKey( ), 121 finder methods (EJB), 120-124 first( ), 48 FormWeb, Inc., 32 G[ Top ] generate( ), 152 generateSequence( ), 152 getBlob( ), 72 getBundle( ), factory method, 141 getClob( ), 72 getColumnCount( ), 88 getColumnDisplaySize( ), 88 getColumnLabel( ), 88 getColumnType( ), 88 getConnection( ), 195 getDefault( ), factory method, 141 getFindSQL( ), 205 getLastUpdateID( ), 197 getLastUpdateTime( ), 197 getMetaData( ), 81 getPropertyInfo( ), 82 getResultSet( ), 80 getRow( ), 49 getString( ), 76 getTransactionIsolation( ), 71 getUpdateCounts( ), 65 getWarnings( ), 51 GIE Dyade, 32 GNU, 32 GUI (see user interface) Gupta Corporation, 8 GWE Technologies, 32 H[ Top ] Heidegger, Martin, xvi, 146 Hit Software, 32 HOB electronic GmbH & Co. KG, 32 home interface (EJB), 119-122, 170-172 Hughes Technologies, 27 I[ Top ] IBM, 8, 32 ID generation, 55 sequence generators and, 149-156 Identifier class, 161 identity tokens and authentication, 157, 160 IDL (Interface Definition Language), 7 IDS Software, 32 I-Kinetics, 32 Imaginary, 32 i-net software, 32 Information Builders, 32 Informix Corporation, 8, 32 init( ), 52 initial contexts, JNDI, 107 INSERT statement, 20 insertRow( ), 69 instances, reusing, 132 InterBase, 32 Interface Definition Language (IDL), 7 interfaces home/remote (EJB), 119-122 remote (RMI), 110 internationalization factory classes and, 141 Java built-in support, 8 requirement for enterprise systems, 5 InterSoft, 8, 32 Intersolv, 8, 32 invokeAndWait( ), 209 invokeLater( ), 209 invokeWorker( ), 223 isAfterLast( ), result set position, 49 isBeforeFirst( ), result set position, 49 isFirst( ), result set position, 49 isLast( ), result set position, 49 isolated database connectivity, 133 IteratorEnumeration class, 217 J[ Top ] Java APIs, 6-8 database programming with, 12-14 interacting with databases, 10 null vs. SQL NULL, 40 object types, 76 platform independence, 6-8 servlet example, 51-56 SQL datatypes, mapping, 44-46, 77 Java DataBase Connectivity (see JDBC) Java Naming and Directory Interface (see JNDI) Java Virtual Machine (JVM), 6 zero-install client concept, 12 JavaBeans API, 7 property change events and, 173 result sets and, 96-99 rowsets and, 96-99, 300-314 (see also EJB (Enterprise JavaBeans)) JAVA_OBJECT type, 77 Java-relational DBMS, 76 JavaSoft, 32 JDBC, 7 alternatives to, 33 API for, 10 Core API classes/interfaces, 227-292 DataSource interface, 93, 297 drivers, 31-33 downloading, 30 scrollable result sets, handling, 49 EJB methods and, 124 exception handling, 38 handling NULL values, 54 meta-data classes, 79-91 SQL terminal monitor application, 82-91 persistence operations, 195-206 prepared statements, 57-59 SQL arrays, 75, 227-229 stored procedures, 60-62 structure of, 27-30 support classes, 50 URLs, 29, 35 using JDBC 2.0 Optional Package, 92 vs. ODBC, 26, 34 warnings, 51 JDBC 2.0 features, 24 advanced datatype support, 71-79 batch processing, 62-67 datatype mappings, 45, 77 Optional Package, 92-101, 293-316 connection pooling, 95, 195 distributed transactions, 99-101 naming and directory services, 93, 106, 297 rowsets, 96-99, 300-314 scrollable result sets (see result sets, scrollable) updatable result sets (see result sets, updatable) jdbc.drivers property registering a driver, 36 JDBC-ODBC bridge, 26, 30 JNDI (Java Naming and Directory Interface), 105-108 connection pooling and, 95 contexts, 107 database access, 93, 106 object binding, 106 object lookup, 107, 171 support in EJB, 120 joins (SELECT statements), 22 JTable UI delegate, 210 JTree class, 208 avoiding data overload, 217-219 JVM (Java Virtual Machine), 6 distributed objects and, 108 zero-install client concept, 12 K[ Top ] Kant, Immanuel, xi, xv KonaSoft, Inc., 32 L[ Top ] last( ), 48 LDAP servers, 94 Liberty Integration Software, 32 listener pattern, 138 listeners, distributed (see distributed listener pattern) load( ), persistence delegate pattern and, 143 logical data models, 18 long-lived events executed by worker threads, 221-223 handling, 209 occurring in event queues, 219 lookup, objects EJB (Enterprise JavaBeans), 170-172 JNDI (Java Naming and Directory Interface), 107, 171 RMI (Remote Method Invocation), 117 Lotus Development, 32 M[ Top ] Management API, 7 marshaling, remote method calls, 112 Media API, 7 Media Frameworks API, 7 Memento class, 194 memento pattern, 143 separating business logic and persistence logic, 194 meta-data classes, JDBC, 79-91 SQL terminal monitor application, 82-91 mid-tier business objects, 134-136 model objects (GUI components), 208 event handling, 209-211 model-delegate pattern, 138, 208 models, database application, 210-219 model-view-controller (MVC) pattern, 138, 208 modification state, 185 moveToCurrentRow( ), 69 moveToInsertRow( ), 69 MsqlDataSource class, 94 mSQL-JDBC driver, 27 JDBC URL for, 30 multithreading, Swing API, 209 MVC (model-view-controller) pattern, 138, 208 N[ Top ] NAA (Network Application Architecture), 136 banking application, 143 Naming class, 111 naming services, 93, 106 DataSource interface, 297 Naming.rebind( ), 109 NetAway, 32 Network Application Architecture (NAA), 136 banking application, 143 network security, 162-164 next( ), 40, 47-49 Nietzsche, Friedrich, xvi, 92 node identifiers, ID generation, 149-152 nodes, root, 215-219 Nogginware Corporation, 33 nonremote objects, passing, 114-116 n-tier architecture (see three-tier architecture) null values, SQL NULL vs. Java null, 40 O[ Top ] object databases, 11 Object Design, 8 Object Management Group (OMG) IDL specification, 7 object serialization, 114-116 object servers, accessing remote objects, 109, 113 object-relational databases, 11 objects binding (JNDI), 106 exporting, 111 lookup EJB, 170-172 JNDI, 107, 171 RMI, 117 modification state of, 185 passing nonremote, 114-116 remote (see RMI) reuse of, 132 ODBC (Open DataBase Connectivity) vs. JDBC, 26, 34 ODBC-JDBC bridge, 26, 30 OMG (Object Management Group) IDL specification, 7 Open DataBase Connectivity (ODBC) vs. JDBC, 26, 34 Open Horizon, 8 OpenLink Software, 8, 33 optimistic concurrency mode, 197 Optional Package (see JDBC 2.0 features, Optional Package) Oracle Corporation, 8, 33 P[ Top ] parameters, binding, 58 passwords, unencrypted, 160 patterns, design, 137-143 business, 140-142 client, 138 composite, 140 data access, 142 distributed listener (see distributed listener pattern) factory, 141 custom client socket factory, 163 listener, 138 memento, 143, 194 model-delegate, 138, 208 model-view-controller (MVC), 138, 208 persistence delegate (see persistence delegate pattern) permanent transactions (see COMMITs) persistence, 183-206 banking application, 144 bean-managed, 124, 147 container-managed, drawbacks of, 124, 147 database transactions and, 183-193 impartiality needed for component model, 184 key behaviors of, 185 modification state, 185 of objects, 142, 185 RMI, no built-in support for, 117 search support, 197-206 separating business logic and persistence logic, 193 using design patterns, 194 persistence delegate pattern, 142 interface behaviors, 143 JDBC persistence, 196 search support, 197 separating business logic and persistence logic, 194 persistence library architecture of, 184 searching for objects using, 170 using JDBC classes, 195 Persistence Software, 8 PersistenceSupport interface, 194, 197 persistent components, 148-156 (see also entity beans) pessimistic concurrency mode, 197 phantom reads, 70 physical data models, 18 platform independence, Java, 6-8 polling threads, 221 PooledConnection interface, 298 pooling, connection, 95, 195, 296 portability date handling, 51 stored procedures and, 61 prepareCall( ), 61 prepared statements, 57-59 vs. stored procedures, 63 PreparedStatement class, 58, 255-258 batch processing, 64 Blob/Clob objects and, 73 when to use, 63 prepareStatement( ), 59 prepareUpdate( ), 168, 185 Presence Information Design, 8 previous( ), 47-49 primary keys, entity beans, 121, 148 printComments( ), 53 Pro-C Ltd., 8 process-oriented components, 148 (see also session beans) processResults( ), 87 methods used by, 88 properties file, for JDBC configuration, 37 PropertyChangeEvent, 173 distributed listeners and, 220 PropertyChangeListener, 220 PropertyChangeListener interface, 139 provider, EJB, 118 Q[ Top ] queries, 39-43 ResultSet class and, 40 subqueries, 22 (see also SELECT statement) query plans, building, 57-59 quotation marks, 19 R[ Top ] rebind( ), 109 Recital Corporation, 8, 33 reconnect( ), 173-181, 221 Ref class, 76, 259 REF type (SQL), 76 refreshRow( ), 71 registerOutParameter( ), 62 relational databases, 11, 15-19 object persistence and, 142 relative( ), 48 Remote interface, 110, 119 remote interfaces EJB (Enterprise JavaBeans), 119-122 RMI (Remote Method Invocation), 110 remote method calls marshaling/unmarshaling, 112 RemoteException, 113 skeletons/stubs, 112 Remote Method Invocation (see RMI) remote objects (see RMI) RemoteException, 113 remove( ), persistence delegate pattern and, 143 repeatable reads, 70 ResourceBundle class, 141 result set concurrency, 46, 67 result sets navigation of, 47-49 rowsets and, 96-99, 300-314 scrollable, 46-50 optimization of, 49 transaction isolation, 70 types, 46 updatable, 67-71 deleting values, 69 getting the latest data, 71 inserting new rows, 69 updating values, 68 using batch processing instead, 68 visibility of changes in, 69-71 ResultSet class, 259-273 queries and, 40 ResultSetMetaData class and, 79-81 rowsets and, 97 scrollable result sets, 46-50 ResultSetMetaData class, 79-81, 273-277 reuse of objects, 132 of source code, 132 RMI (Remote Method Invocation), 7 accessing remote objects, 13, 109, 113 application servers, 114 binding objects to URLs, 109 creating remote interfaces, 110 distributed computing support, 9 encrypting network communications, 162-164 exporting objects, 111 marshaling/unmarshaling, 112 object servers, 113 shortcomings of, 116 skeletons/stubs, 112 structure of, 108-113 vs. CORBA, 108 vs. EJB (Enterprise JavaBeans), 116 rmic (RMI compiler) command, 111 RogueWave Software, 8 rollback( ), 170 JDBC transactions, 193 ROLLBACKs, 23 mSQL and, 30 root nodes, 215-219 RootNode class (code example), 215-217 RowSet interface, 97-99, 300-306 constructing a model for database access, 211-215 RowSetEvent class, 306 RowSetInternal interface, 307 RowSetListener interface, 98, 308 RowSetMetaData interface, 309-312 RowSetReader interface, 313 rowsets, 96-99, 300-314 JavaBeans events, 98 RowSetWriter interface, 313 rules (see business rules) run( ), 209 S[ Top ] Sartre, Jean-Paul, xvi, 207 SAS Institute Inc., 8, 33 save( ), 220 SCO, 8, 33 scrollable result sets (see result sets, scrollable) SearchBinding class, 171 SearchCriteria class, 171, 205 searching for objects (see lookup, objects) using the persistence delegate, 197-206 secure socket layer (SSL) sockets, 162 Security API, 8 security issues components authentication, 156-161 identity tokens, 157, 160 unencrypted passwords, 160 validation, 161 databases, 164 distributed systems, 156-164, 167-169 networks, 162-164 RMI (Remote Method Invocation), 116 SELECT statement, 22, 39-43 (see also queries) sequence generators, ID generation, 149-156 SequenceGenerator class, code examples, 150-152, 153-156 Serializable interface, 115 serialization, object, 114-116 Server API, 8 server provider, EJB, 118 service providers, JNDI, 106 servlets, Java, 8 session beans, 119 (see also process-oriented components) SessionBean method, 121 setAutoCommit( ), 42 setBlob( ), 73 setClob( ), 73 setFetchDirection( ), 49 setFetchSize( ), 49 setString( ), 76 Simba Technologies, Inc., 33 single quotation marks ('), 19 skeletons and remote method calls, 112 Socket class, 162 sockets, 162-164 custom socket factories, 162 Software AG, 33 Solid Information Technology, 33 source code reuse, 132 special exception, remote methods, 113 SQL language, 10, 19-23 arrays, 75, 227-229 Java datatypes, mapping, 44-46, 77 NULL vs. Java null, 40 prepared statements, 57-59 SQL2, 23 datatype support, 44, 71 SQL3, 24 array objects, 227-229 datatype mappings, 45 datatype support, 76 structured types, 287 SQL/92, 23 stored procedures, 60-62 transaction logic, 23 VARCHAR datatype, 44 SQLData class, 277 SQLException class, 50 SQLInput class, 279 SQLJ paradigm, 34 SQLOutput class, 280-282 SQLWarning class, 51 SSL (secure socket layer) sockets, 162 StarQuest Software, 33 Statement class, 39, 282-287 batch processing, 64 execute( ) and, 80 PreparedStatement interface and, 58 when to use, 63 store( ), persistence delegate pattern and, 143, 196 stored procedures, 10, 60-62 vs. prepared statements, 63 Struct class, 76, 287 STRUCT type (SQL), 76 stubs and remote method calls, 112 subqueries, 22 Support class (full source code), 197-205 support classes, 50 Swing API, 138, 208-223 distributed listeners, 219-221 event queues, 209 handling long-lived events, 209 model-delegate architecture, 208 multithreading in, 209 MVC (model-view-controller), 208 three-tier database applications, 215-219 tree component support, 215 two-tier database application, 210-215 UI delegates, 208 monitoring models for changes, 219-221 worker threads, 221-223 SwingUtilities class, 209 Sybase, 8, 33 Symantec, 8, 33 system administrator, EJB, 118 T[ Top ] TableModel mode, 211 Telephony API, 8 ThinWeb SoftWare, 33 threads, Swing API, 209 three-tier architecture, 133-136 banking application, 143 centralized data processing, 134 data presentation, 135 drawbacks to, 136 Network Application Architecture, 136 three-tier database applications, 215-219 Thunderstone, 8 Time class, 51, 288 Timestamp class, 51, 289-291 tjFM, 33 /tmp/jdbc directory, 107 tokens, identity, 157, 160 Transaction class, 166-169 generic transaction logic (code example), 186-192 transaction isolation, 70 transaction management, 10 EJB (Enterprise JavaBeans), 165-170 TRANSACTION_NONE, 70 TRANSACTION_READ_COMMITTED, 70 TRANSACTION_READ_UNCOMMITTED, 70 TRANSACTION_REPEATABLE_READ, 71 transactions, 23 aborting (see ROLLBACKs) boundaries, 166 deadlocks, 170 distributed, 99-101 exception handling, 167 permanent (see COMMITs) persistence and, 183-193 RMI, no built-in support for, 117 tracking changes to, 167-169, 185 visibility issues, 70 TRANSACTION_SERIALIZABLE, 71 tree components, Swing support for, 215 TreeModel class, 208 three-tier database application, 215 TreeNode implementations, 215 Trifox, Inc., 33 two-phase commits, 165 two-tier architecture, 129-133 fat-client systems, 131 limitations to, 131 object reuse, 132 using Java with, 130 when to use, 133 two-tier database applications, 210-215 type mapping system, JDBC 2.0, 77 TYPE_FORWARD_ONLY result set, 46 type-map object, 77 Types class, 50, 77, 291 TYPE_SCROLL_INSENSITIVE result set, 46, 69 TYPE_SCROLL_SENSITIVE result set, 46, 69 U[ Top ] UI delegates, Swing API, 208 monitoring models for changes, 219-221 UML diagrams, 127 component transactions, 186 composite pattern, 140 distributed listener pattern, 139 mid-tier business objects, 144 unencrypted passwords, 160 UnicastRemoteObject class, 111 providing custom socket factories, 164 Unicode, Java strings, 8 Unified Modeling Language (see UML diagrams) uniform resource locators (see URLs) unique identifiers, distributed components, 149-156, 170-172 unmarshaling, remote method calls, 112 updatable result sets (see result sets, updatable) UPDATE statement, 21 updateRow( ), 68 URLs, 29, 35 binding objects to, 109 RMI (Remote Method Invocation), 109 URL lookups, 111 using JDBC 2.0 Optional Package, 92 user interface, 207-223 accessibility issues, 9 banking application, 145 business objects and, 135 client patterns and, 138 V[ Top ] validation, component security, 161 VARBINARY datatype, 72 VARCHAR datatype, 44, 72 vendors, JDBC driver, 31-33 views (GUI widgets), 208 visibility of changes, updatable result sets, 69-71 Visigenic, 33 W[ Top ] warnings, JDBC, 51 wasNull( ), 41 WHERE clause, 21 Wittgenstein, Ludwig, xvi, 126, 183 worker threads, Swing API, 221-223 WorkerThread object, 221 X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
G[ Top ] generate( ), 152 generateSequence( ), 152 getBlob( ), 72 getBundle( ), factory method, 141 getClob( ), 72 getColumnCount( ), 88 getColumnDisplaySize( ), 88 getColumnLabel( ), 88 getColumnType( ), 88 getConnection( ), 195 getDefault( ), factory method, 141 getFindSQL( ), 205 getLastUpdateID( ), 197 getLastUpdateTime( ), 197 getMetaData( ), 81 getPropertyInfo( ), 82 getResultSet( ), 80 getRow( ), 49 getString( ), 76 getTransactionIsolation( ), 71 getUpdateCounts( ), 65 getWarnings( ), 51 GIE Dyade, 32 GNU, 32 GUI (see user interface) Gupta Corporation, 8 GWE Technologies, 32 H[ Top ] Heidegger, Martin, xvi, 146 Hit Software, 32 HOB electronic GmbH & Co. KG, 32 home interface (EJB), 119-122, 170-172 Hughes Technologies, 27 I[ Top ] IBM, 8, 32 ID generation, 55 sequence generators and, 149-156 Identifier class, 161 identity tokens and authentication, 157, 160 IDL (Interface Definition Language), 7 IDS Software, 32 I-Kinetics, 32 Imaginary, 32 i-net software, 32 Information Builders, 32 Informix Corporation, 8, 32 init( ), 52 initial contexts, JNDI, 107 INSERT statement, 20 insertRow( ), 69 instances, reusing, 132 InterBase, 32 Interface Definition Language (IDL), 7 interfaces home/remote (EJB), 119-122 remote (RMI), 110 internationalization factory classes and, 141 Java built-in support, 8 requirement for enterprise systems, 5 InterSoft, 8, 32 Intersolv, 8, 32 invokeAndWait( ), 209 invokeLater( ), 209 invokeWorker( ), 223 isAfterLast( ), result set position, 49 isBeforeFirst( ), result set position, 49 isFirst( ), result set position, 49 isLast( ), result set position, 49 isolated database connectivity, 133 IteratorEnumeration class, 217 J[ Top ] Java APIs, 6-8 database programming with, 12-14 interacting with databases, 10 null vs. SQL NULL, 40 object types, 76 platform independence, 6-8 servlet example, 51-56 SQL datatypes, mapping, 44-46, 77 Java DataBase Connectivity (see JDBC) Java Naming and Directory Interface (see JNDI) Java Virtual Machine (JVM), 6 zero-install client concept, 12 JavaBeans API, 7 property change events and, 173 result sets and, 96-99 rowsets and, 96-99, 300-314 (see also EJB (Enterprise JavaBeans)) JAVA_OBJECT type, 77 Java-relational DBMS, 76 JavaSoft, 32 JDBC, 7 alternatives to, 33 API for, 10 Core API classes/interfaces, 227-292 DataSource interface, 93, 297 drivers, 31-33 downloading, 30 scrollable result sets, handling, 49 EJB methods and, 124 exception handling, 38 handling NULL values, 54 meta-data classes, 79-91 SQL terminal monitor application, 82-91 persistence operations, 195-206 prepared statements, 57-59 SQL arrays, 75, 227-229 stored procedures, 60-62 structure of, 27-30 support classes, 50 URLs, 29, 35 using JDBC 2.0 Optional Package, 92 vs. ODBC, 26, 34 warnings, 51 JDBC 2.0 features, 24 advanced datatype support, 71-79 batch processing, 62-67 datatype mappings, 45, 77 Optional Package, 92-101, 293-316 connection pooling, 95, 195 distributed transactions, 99-101 naming and directory services, 93, 106, 297 rowsets, 96-99, 300-314 scrollable result sets (see result sets, scrollable) updatable result sets (see result sets, updatable) jdbc.drivers property registering a driver, 36 JDBC-ODBC bridge, 26, 30 JNDI (Java Naming and Directory Interface), 105-108 connection pooling and, 95 contexts, 107 database access, 93, 106 object binding, 106 object lookup, 107, 171 support in EJB, 120 joins (SELECT statements), 22 JTable UI delegate, 210 JTree class, 208 avoiding data overload, 217-219 JVM (Java Virtual Machine), 6 distributed objects and, 108 zero-install client concept, 12 K[ Top ] Kant, Immanuel, xi, xv KonaSoft, Inc., 32 L[ Top ] last( ), 48 LDAP servers, 94 Liberty Integration Software, 32 listener pattern, 138 listeners, distributed (see distributed listener pattern) load( ), persistence delegate pattern and, 143 logical data models, 18 long-lived events executed by worker threads, 221-223 handling, 209 occurring in event queues, 219 lookup, objects EJB (Enterprise JavaBeans), 170-172 JNDI (Java Naming and Directory Interface), 107, 171 RMI (Remote Method Invocation), 117 Lotus Development, 32 M[ Top ] Management API, 7 marshaling, remote method calls, 112 Media API, 7 Media Frameworks API, 7 Memento class, 194 memento pattern, 143 separating business logic and persistence logic, 194 meta-data classes, JDBC, 79-91 SQL terminal monitor application, 82-91 mid-tier business objects, 134-136 model objects (GUI components), 208 event handling, 209-211 model-delegate pattern, 138, 208 models, database application, 210-219 model-view-controller (MVC) pattern, 138, 208 modification state, 185 moveToCurrentRow( ), 69 moveToInsertRow( ), 69 MsqlDataSource class, 94 mSQL-JDBC driver, 27 JDBC URL for, 30 multithreading, Swing API, 209 MVC (model-view-controller) pattern, 138, 208 N[ Top ] NAA (Network Application Architecture), 136 banking application, 143 Naming class, 111 naming services, 93, 106 DataSource interface, 297 Naming.rebind( ), 109 NetAway, 32 Network Application Architecture (NAA), 136 banking application, 143 network security, 162-164 next( ), 40, 47-49 Nietzsche, Friedrich, xvi, 92 node identifiers, ID generation, 149-152 nodes, root, 215-219 Nogginware Corporation, 33 nonremote objects, passing, 114-116 n-tier architecture (see three-tier architecture) null values, SQL NULL vs. Java null, 40 O[ Top ] object databases, 11 Object Design, 8 Object Management Group (OMG) IDL specification, 7 object serialization, 114-116 object servers, accessing remote objects, 109, 113 object-relational databases, 11 objects binding (JNDI), 106 exporting, 111 lookup EJB, 170-172 JNDI, 107, 171 RMI, 117 modification state of, 185 passing nonremote, 114-116 remote (see RMI) reuse of, 132 ODBC (Open DataBase Connectivity) vs. JDBC, 26, 34 ODBC-JDBC bridge, 26, 30 OMG (Object Management Group) IDL specification, 7 Open DataBase Connectivity (ODBC) vs. JDBC, 26, 34 Open Horizon, 8 OpenLink Software, 8, 33 optimistic concurrency mode, 197 Optional Package (see JDBC 2.0 features, Optional Package) Oracle Corporation, 8, 33 P[ Top ] parameters, binding, 58 passwords, unencrypted, 160 patterns, design, 137-143 business, 140-142 client, 138 composite, 140 data access, 142 distributed listener (see distributed listener pattern) factory, 141 custom client socket factory, 163 listener, 138 memento, 143, 194 model-delegate, 138, 208 model-view-controller (MVC), 138, 208 persistence delegate (see persistence delegate pattern) permanent transactions (see COMMITs) persistence, 183-206 banking application, 144 bean-managed, 124, 147 container-managed, drawbacks of, 124, 147 database transactions and, 183-193 impartiality needed for component model, 184 key behaviors of, 185 modification state, 185 of objects, 142, 185 RMI, no built-in support for, 117 search support, 197-206 separating business logic and persistence logic, 193 using design patterns, 194 persistence delegate pattern, 142 interface behaviors, 143 JDBC persistence, 196 search support, 197 separating business logic and persistence logic, 194 persistence library architecture of, 184 searching for objects using, 170 using JDBC classes, 195 Persistence Software, 8 PersistenceSupport interface, 194, 197 persistent components, 148-156 (see also entity beans) pessimistic concurrency mode, 197 phantom reads, 70 physical data models, 18 platform independence, Java, 6-8 polling threads, 221 PooledConnection interface, 298 pooling, connection, 95, 195, 296 portability date handling, 51 stored procedures and, 61 prepareCall( ), 61 prepared statements, 57-59 vs. stored procedures, 63 PreparedStatement class, 58, 255-258 batch processing, 64 Blob/Clob objects and, 73 when to use, 63 prepareStatement( ), 59 prepareUpdate( ), 168, 185 Presence Information Design, 8 previous( ), 47-49 primary keys, entity beans, 121, 148 printComments( ), 53 Pro-C Ltd., 8 process-oriented components, 148 (see also session beans) processResults( ), 87 methods used by, 88 properties file, for JDBC configuration, 37 PropertyChangeEvent, 173 distributed listeners and, 220 PropertyChangeListener, 220 PropertyChangeListener interface, 139 provider, EJB, 118 Q[ Top ] queries, 39-43 ResultSet class and, 40 subqueries, 22 (see also SELECT statement) query plans, building, 57-59 quotation marks, 19 R[ Top ] rebind( ), 109 Recital Corporation, 8, 33 reconnect( ), 173-181, 221 Ref class, 76, 259 REF type (SQL), 76 refreshRow( ), 71 registerOutParameter( ), 62 relational databases, 11, 15-19 object persistence and, 142 relative( ), 48 Remote interface, 110, 119 remote interfaces EJB (Enterprise JavaBeans), 119-122 RMI (Remote Method Invocation), 110 remote method calls marshaling/unmarshaling, 112 RemoteException, 113 skeletons/stubs, 112 Remote Method Invocation (see RMI) remote objects (see RMI) RemoteException, 113 remove( ), persistence delegate pattern and, 143 repeatable reads, 70 ResourceBundle class, 141 result set concurrency, 46, 67 result sets navigation of, 47-49 rowsets and, 96-99, 300-314 scrollable, 46-50 optimization of, 49 transaction isolation, 70 types, 46 updatable, 67-71 deleting values, 69 getting the latest data, 71 inserting new rows, 69 updating values, 68 using batch processing instead, 68 visibility of changes in, 69-71 ResultSet class, 259-273 queries and, 40 ResultSetMetaData class and, 79-81 rowsets and, 97 scrollable result sets, 46-50 ResultSetMetaData class, 79-81, 273-277 reuse of objects, 132 of source code, 132 RMI (Remote Method Invocation), 7 accessing remote objects, 13, 109, 113 application servers, 114 binding objects to URLs, 109 creating remote interfaces, 110 distributed computing support, 9 encrypting network communications, 162-164 exporting objects, 111 marshaling/unmarshaling, 112 object servers, 113 shortcomings of, 116 skeletons/stubs, 112 structure of, 108-113 vs. CORBA, 108 vs. EJB (Enterprise JavaBeans), 116 rmic (RMI compiler) command, 111 RogueWave Software, 8 rollback( ), 170 JDBC transactions, 193 ROLLBACKs, 23 mSQL and, 30 root nodes, 215-219 RootNode class (code example), 215-217 RowSet interface, 97-99, 300-306 constructing a model for database access, 211-215 RowSetEvent class, 306 RowSetInternal interface, 307 RowSetListener interface, 98, 308 RowSetMetaData interface, 309-312 RowSetReader interface, 313 rowsets, 96-99, 300-314 JavaBeans events, 98 RowSetWriter interface, 313 rules (see business rules) run( ), 209 S[ Top ] Sartre, Jean-Paul, xvi, 207 SAS Institute Inc., 8, 33 save( ), 220 SCO, 8, 33 scrollable result sets (see result sets, scrollable) SearchBinding class, 171 SearchCriteria class, 171, 205 searching for objects (see lookup, objects) using the persistence delegate, 197-206 secure socket layer (SSL) sockets, 162 Security API, 8 security issues components authentication, 156-161 identity tokens, 157, 160 unencrypted passwords, 160 validation, 161 databases, 164 distributed systems, 156-164, 167-169 networks, 162-164 RMI (Remote Method Invocation), 116 SELECT statement, 22, 39-43 (see also queries) sequence generators, ID generation, 149-156 SequenceGenerator class, code examples, 150-152, 153-156 Serializable interface, 115 serialization, object, 114-116 Server API, 8 server provider, EJB, 118 service providers, JNDI, 106 servlets, Java, 8 session beans, 119 (see also process-oriented components) SessionBean method, 121 setAutoCommit( ), 42 setBlob( ), 73 setClob( ), 73 setFetchDirection( ), 49 setFetchSize( ), 49 setString( ), 76 Simba Technologies, Inc., 33 single quotation marks ('), 19 skeletons and remote method calls, 112 Socket class, 162 sockets, 162-164 custom socket factories, 162 Software AG, 33 Solid Information Technology, 33 source code reuse, 132 special exception, remote methods, 113 SQL language, 10, 19-23 arrays, 75, 227-229 Java datatypes, mapping, 44-46, 77 NULL vs. Java null, 40 prepared statements, 57-59 SQL2, 23 datatype support, 44, 71 SQL3, 24 array objects, 227-229 datatype mappings, 45 datatype support, 76 structured types, 287 SQL/92, 23 stored procedures, 60-62 transaction logic, 23 VARCHAR datatype, 44 SQLData class, 277 SQLException class, 50 SQLInput class, 279 SQLJ paradigm, 34 SQLOutput class, 280-282 SQLWarning class, 51 SSL (secure socket layer) sockets, 162 StarQuest Software, 33 Statement class, 39, 282-287 batch processing, 64 execute( ) and, 80 PreparedStatement interface and, 58 when to use, 63 store( ), persistence delegate pattern and, 143, 196 stored procedures, 10, 60-62 vs. prepared statements, 63 Struct class, 76, 287 STRUCT type (SQL), 76 stubs and remote method calls, 112 subqueries, 22 Support class (full source code), 197-205 support classes, 50 Swing API, 138, 208-223 distributed listeners, 219-221 event queues, 209 handling long-lived events, 209 model-delegate architecture, 208 multithreading in, 209 MVC (model-view-controller), 208 three-tier database applications, 215-219 tree component support, 215 two-tier database application, 210-215 UI delegates, 208 monitoring models for changes, 219-221 worker threads, 221-223 SwingUtilities class, 209 Sybase, 8, 33 Symantec, 8, 33 system administrator, EJB, 118 T[ Top ] TableModel mode, 211 Telephony API, 8 ThinWeb SoftWare, 33 threads, Swing API, 209 three-tier architecture, 133-136 banking application, 143 centralized data processing, 134 data presentation, 135 drawbacks to, 136 Network Application Architecture, 136 three-tier database applications, 215-219 Thunderstone, 8 Time class, 51, 288 Timestamp class, 51, 289-291 tjFM, 33 /tmp/jdbc directory, 107 tokens, identity, 157, 160 Transaction class, 166-169 generic transaction logic (code example), 186-192 transaction isolation, 70 transaction management, 10 EJB (Enterprise JavaBeans), 165-170 TRANSACTION_NONE, 70 TRANSACTION_READ_COMMITTED, 70 TRANSACTION_READ_UNCOMMITTED, 70 TRANSACTION_REPEATABLE_READ, 71 transactions, 23 aborting (see ROLLBACKs) boundaries, 166 deadlocks, 170 distributed, 99-101 exception handling, 167 permanent (see COMMITs) persistence and, 183-193 RMI, no built-in support for, 117 tracking changes to, 167-169, 185 visibility issues, 70 TRANSACTION_SERIALIZABLE, 71 tree components, Swing support for, 215 TreeModel class, 208 three-tier database application, 215 TreeNode implementations, 215 Trifox, Inc., 33 two-phase commits, 165 two-tier architecture, 129-133 fat-client systems, 131 limitations to, 131 object reuse, 132 using Java with, 130 when to use, 133 two-tier database applications, 210-215 type mapping system, JDBC 2.0, 77 TYPE_FORWARD_ONLY result set, 46 type-map object, 77 Types class, 50, 77, 291 TYPE_SCROLL_INSENSITIVE result set, 46, 69 TYPE_SCROLL_SENSITIVE result set, 46, 69 U[ Top ] UI delegates, Swing API, 208 monitoring models for changes, 219-221 UML diagrams, 127 component transactions, 186 composite pattern, 140 distributed listener pattern, 139 mid-tier business objects, 144 unencrypted passwords, 160 UnicastRemoteObject class, 111 providing custom socket factories, 164 Unicode, Java strings, 8 Unified Modeling Language (see UML diagrams) uniform resource locators (see URLs) unique identifiers, distributed components, 149-156, 170-172 unmarshaling, remote method calls, 112 updatable result sets (see result sets, updatable) UPDATE statement, 21 updateRow( ), 68 URLs, 29, 35 binding objects to, 109 RMI (Remote Method Invocation), 109 URL lookups, 111 using JDBC 2.0 Optional Package, 92 user interface, 207-223 accessibility issues, 9 banking application, 145 business objects and, 135 client patterns and, 138 V[ Top ] validation, component security, 161 VARBINARY datatype, 72 VARCHAR datatype, 44, 72 vendors, JDBC driver, 31-33 views (GUI widgets), 208 visibility of changes, updatable result sets, 69-71 Visigenic, 33 W[ Top ] warnings, JDBC, 51 wasNull( ), 41 WHERE clause, 21 Wittgenstein, Ludwig, xvi, 126, 183 worker threads, Swing API, 221-223 WorkerThread object, 221 X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
H[ Top ] Heidegger, Martin, xvi, 146 Hit Software, 32 HOB electronic GmbH & Co. KG, 32 home interface (EJB), 119-122, 170-172 Hughes Technologies, 27 I[ Top ] IBM, 8, 32 ID generation, 55 sequence generators and, 149-156 Identifier class, 161 identity tokens and authentication, 157, 160 IDL (Interface Definition Language), 7 IDS Software, 32 I-Kinetics, 32 Imaginary, 32 i-net software, 32 Information Builders, 32 Informix Corporation, 8, 32 init( ), 52 initial contexts, JNDI, 107 INSERT statement, 20 insertRow( ), 69 instances, reusing, 132 InterBase, 32 Interface Definition Language (IDL), 7 interfaces home/remote (EJB), 119-122 remote (RMI), 110 internationalization factory classes and, 141 Java built-in support, 8 requirement for enterprise systems, 5 InterSoft, 8, 32 Intersolv, 8, 32 invokeAndWait( ), 209 invokeLater( ), 209 invokeWorker( ), 223 isAfterLast( ), result set position, 49 isBeforeFirst( ), result set position, 49 isFirst( ), result set position, 49 isLast( ), result set position, 49 isolated database connectivity, 133 IteratorEnumeration class, 217 J[ Top ] Java APIs, 6-8 database programming with, 12-14 interacting with databases, 10 null vs. SQL NULL, 40 object types, 76 platform independence, 6-8 servlet example, 51-56 SQL datatypes, mapping, 44-46, 77 Java DataBase Connectivity (see JDBC) Java Naming and Directory Interface (see JNDI) Java Virtual Machine (JVM), 6 zero-install client concept, 12 JavaBeans API, 7 property change events and, 173 result sets and, 96-99 rowsets and, 96-99, 300-314 (see also EJB (Enterprise JavaBeans)) JAVA_OBJECT type, 77 Java-relational DBMS, 76 JavaSoft, 32 JDBC, 7 alternatives to, 33 API for, 10 Core API classes/interfaces, 227-292 DataSource interface, 93, 297 drivers, 31-33 downloading, 30 scrollable result sets, handling, 49 EJB methods and, 124 exception handling, 38 handling NULL values, 54 meta-data classes, 79-91 SQL terminal monitor application, 82-91 persistence operations, 195-206 prepared statements, 57-59 SQL arrays, 75, 227-229 stored procedures, 60-62 structure of, 27-30 support classes, 50 URLs, 29, 35 using JDBC 2.0 Optional Package, 92 vs. ODBC, 26, 34 warnings, 51 JDBC 2.0 features, 24 advanced datatype support, 71-79 batch processing, 62-67 datatype mappings, 45, 77 Optional Package, 92-101, 293-316 connection pooling, 95, 195 distributed transactions, 99-101 naming and directory services, 93, 106, 297 rowsets, 96-99, 300-314 scrollable result sets (see result sets, scrollable) updatable result sets (see result sets, updatable) jdbc.drivers property registering a driver, 36 JDBC-ODBC bridge, 26, 30 JNDI (Java Naming and Directory Interface), 105-108 connection pooling and, 95 contexts, 107 database access, 93, 106 object binding, 106 object lookup, 107, 171 support in EJB, 120 joins (SELECT statements), 22 JTable UI delegate, 210 JTree class, 208 avoiding data overload, 217-219 JVM (Java Virtual Machine), 6 distributed objects and, 108 zero-install client concept, 12 K[ Top ] Kant, Immanuel, xi, xv KonaSoft, Inc., 32 L[ Top ] last( ), 48 LDAP servers, 94 Liberty Integration Software, 32 listener pattern, 138 listeners, distributed (see distributed listener pattern) load( ), persistence delegate pattern and, 143 logical data models, 18 long-lived events executed by worker threads, 221-223 handling, 209 occurring in event queues, 219 lookup, objects EJB (Enterprise JavaBeans), 170-172 JNDI (Java Naming and Directory Interface), 107, 171 RMI (Remote Method Invocation), 117 Lotus Development, 32 M[ Top ] Management API, 7 marshaling, remote method calls, 112 Media API, 7 Media Frameworks API, 7 Memento class, 194 memento pattern, 143 separating business logic and persistence logic, 194 meta-data classes, JDBC, 79-91 SQL terminal monitor application, 82-91 mid-tier business objects, 134-136 model objects (GUI components), 208 event handling, 209-211 model-delegate pattern, 138, 208 models, database application, 210-219 model-view-controller (MVC) pattern, 138, 208 modification state, 185 moveToCurrentRow( ), 69 moveToInsertRow( ), 69 MsqlDataSource class, 94 mSQL-JDBC driver, 27 JDBC URL for, 30 multithreading, Swing API, 209 MVC (model-view-controller) pattern, 138, 208 N[ Top ] NAA (Network Application Architecture), 136 banking application, 143 Naming class, 111 naming services, 93, 106 DataSource interface, 297 Naming.rebind( ), 109 NetAway, 32 Network Application Architecture (NAA), 136 banking application, 143 network security, 162-164 next( ), 40, 47-49 Nietzsche, Friedrich, xvi, 92 node identifiers, ID generation, 149-152 nodes, root, 215-219 Nogginware Corporation, 33 nonremote objects, passing, 114-116 n-tier architecture (see three-tier architecture) null values, SQL NULL vs. Java null, 40 O[ Top ] object databases, 11 Object Design, 8 Object Management Group (OMG) IDL specification, 7 object serialization, 114-116 object servers, accessing remote objects, 109, 113 object-relational databases, 11 objects binding (JNDI), 106 exporting, 111 lookup EJB, 170-172 JNDI, 107, 171 RMI, 117 modification state of, 185 passing nonremote, 114-116 remote (see RMI) reuse of, 132 ODBC (Open DataBase Connectivity) vs. JDBC, 26, 34 ODBC-JDBC bridge, 26, 30 OMG (Object Management Group) IDL specification, 7 Open DataBase Connectivity (ODBC) vs. JDBC, 26, 34 Open Horizon, 8 OpenLink Software, 8, 33 optimistic concurrency mode, 197 Optional Package (see JDBC 2.0 features, Optional Package) Oracle Corporation, 8, 33 P[ Top ] parameters, binding, 58 passwords, unencrypted, 160 patterns, design, 137-143 business, 140-142 client, 138 composite, 140 data access, 142 distributed listener (see distributed listener pattern) factory, 141 custom client socket factory, 163 listener, 138 memento, 143, 194 model-delegate, 138, 208 model-view-controller (MVC), 138, 208 persistence delegate (see persistence delegate pattern) permanent transactions (see COMMITs) persistence, 183-206 banking application, 144 bean-managed, 124, 147 container-managed, drawbacks of, 124, 147 database transactions and, 183-193 impartiality needed for component model, 184 key behaviors of, 185 modification state, 185 of objects, 142, 185 RMI, no built-in support for, 117 search support, 197-206 separating business logic and persistence logic, 193 using design patterns, 194 persistence delegate pattern, 142 interface behaviors, 143 JDBC persistence, 196 search support, 197 separating business logic and persistence logic, 194 persistence library architecture of, 184 searching for objects using, 170 using JDBC classes, 195 Persistence Software, 8 PersistenceSupport interface, 194, 197 persistent components, 148-156 (see also entity beans) pessimistic concurrency mode, 197 phantom reads, 70 physical data models, 18 platform independence, Java, 6-8 polling threads, 221 PooledConnection interface, 298 pooling, connection, 95, 195, 296 portability date handling, 51 stored procedures and, 61 prepareCall( ), 61 prepared statements, 57-59 vs. stored procedures, 63 PreparedStatement class, 58, 255-258 batch processing, 64 Blob/Clob objects and, 73 when to use, 63 prepareStatement( ), 59 prepareUpdate( ), 168, 185 Presence Information Design, 8 previous( ), 47-49 primary keys, entity beans, 121, 148 printComments( ), 53 Pro-C Ltd., 8 process-oriented components, 148 (see also session beans) processResults( ), 87 methods used by, 88 properties file, for JDBC configuration, 37 PropertyChangeEvent, 173 distributed listeners and, 220 PropertyChangeListener, 220 PropertyChangeListener interface, 139 provider, EJB, 118 Q[ Top ] queries, 39-43 ResultSet class and, 40 subqueries, 22 (see also SELECT statement) query plans, building, 57-59 quotation marks, 19 R[ Top ] rebind( ), 109 Recital Corporation, 8, 33 reconnect( ), 173-181, 221 Ref class, 76, 259 REF type (SQL), 76 refreshRow( ), 71 registerOutParameter( ), 62 relational databases, 11, 15-19 object persistence and, 142 relative( ), 48 Remote interface, 110, 119 remote interfaces EJB (Enterprise JavaBeans), 119-122 RMI (Remote Method Invocation), 110 remote method calls marshaling/unmarshaling, 112 RemoteException, 113 skeletons/stubs, 112 Remote Method Invocation (see RMI) remote objects (see RMI) RemoteException, 113 remove( ), persistence delegate pattern and, 143 repeatable reads, 70 ResourceBundle class, 141 result set concurrency, 46, 67 result sets navigation of, 47-49 rowsets and, 96-99, 300-314 scrollable, 46-50 optimization of, 49 transaction isolation, 70 types, 46 updatable, 67-71 deleting values, 69 getting the latest data, 71 inserting new rows, 69 updating values, 68 using batch processing instead, 68 visibility of changes in, 69-71 ResultSet class, 259-273 queries and, 40 ResultSetMetaData class and, 79-81 rowsets and, 97 scrollable result sets, 46-50 ResultSetMetaData class, 79-81, 273-277 reuse of objects, 132 of source code, 132 RMI (Remote Method Invocation), 7 accessing remote objects, 13, 109, 113 application servers, 114 binding objects to URLs, 109 creating remote interfaces, 110 distributed computing support, 9 encrypting network communications, 162-164 exporting objects, 111 marshaling/unmarshaling, 112 object servers, 113 shortcomings of, 116 skeletons/stubs, 112 structure of, 108-113 vs. CORBA, 108 vs. EJB (Enterprise JavaBeans), 116 rmic (RMI compiler) command, 111 RogueWave Software, 8 rollback( ), 170 JDBC transactions, 193 ROLLBACKs, 23 mSQL and, 30 root nodes, 215-219 RootNode class (code example), 215-217 RowSet interface, 97-99, 300-306 constructing a model for database access, 211-215 RowSetEvent class, 306 RowSetInternal interface, 307 RowSetListener interface, 98, 308 RowSetMetaData interface, 309-312 RowSetReader interface, 313 rowsets, 96-99, 300-314 JavaBeans events, 98 RowSetWriter interface, 313 rules (see business rules) run( ), 209 S[ Top ] Sartre, Jean-Paul, xvi, 207 SAS Institute Inc., 8, 33 save( ), 220 SCO, 8, 33 scrollable result sets (see result sets, scrollable) SearchBinding class, 171 SearchCriteria class, 171, 205 searching for objects (see lookup, objects) using the persistence delegate, 197-206 secure socket layer (SSL) sockets, 162 Security API, 8 security issues components authentication, 156-161 identity tokens, 157, 160 unencrypted passwords, 160 validation, 161 databases, 164 distributed systems, 156-164, 167-169 networks, 162-164 RMI (Remote Method Invocation), 116 SELECT statement, 22, 39-43 (see also queries) sequence generators, ID generation, 149-156 SequenceGenerator class, code examples, 150-152, 153-156 Serializable interface, 115 serialization, object, 114-116 Server API, 8 server provider, EJB, 118 service providers, JNDI, 106 servlets, Java, 8 session beans, 119 (see also process-oriented components) SessionBean method, 121 setAutoCommit( ), 42 setBlob( ), 73 setClob( ), 73 setFetchDirection( ), 49 setFetchSize( ), 49 setString( ), 76 Simba Technologies, Inc., 33 single quotation marks ('), 19 skeletons and remote method calls, 112 Socket class, 162 sockets, 162-164 custom socket factories, 162 Software AG, 33 Solid Information Technology, 33 source code reuse, 132 special exception, remote methods, 113 SQL language, 10, 19-23 arrays, 75, 227-229 Java datatypes, mapping, 44-46, 77 NULL vs. Java null, 40 prepared statements, 57-59 SQL2, 23 datatype support, 44, 71 SQL3, 24 array objects, 227-229 datatype mappings, 45 datatype support, 76 structured types, 287 SQL/92, 23 stored procedures, 60-62 transaction logic, 23 VARCHAR datatype, 44 SQLData class, 277 SQLException class, 50 SQLInput class, 279 SQLJ paradigm, 34 SQLOutput class, 280-282 SQLWarning class, 51 SSL (secure socket layer) sockets, 162 StarQuest Software, 33 Statement class, 39, 282-287 batch processing, 64 execute( ) and, 80 PreparedStatement interface and, 58 when to use, 63 store( ), persistence delegate pattern and, 143, 196 stored procedures, 10, 60-62 vs. prepared statements, 63 Struct class, 76, 287 STRUCT type (SQL), 76 stubs and remote method calls, 112 subqueries, 22 Support class (full source code), 197-205 support classes, 50 Swing API, 138, 208-223 distributed listeners, 219-221 event queues, 209 handling long-lived events, 209 model-delegate architecture, 208 multithreading in, 209 MVC (model-view-controller), 208 three-tier database applications, 215-219 tree component support, 215 two-tier database application, 210-215 UI delegates, 208 monitoring models for changes, 219-221 worker threads, 221-223 SwingUtilities class, 209 Sybase, 8, 33 Symantec, 8, 33 system administrator, EJB, 118 T[ Top ] TableModel mode, 211 Telephony API, 8 ThinWeb SoftWare, 33 threads, Swing API, 209 three-tier architecture, 133-136 banking application, 143 centralized data processing, 134 data presentation, 135 drawbacks to, 136 Network Application Architecture, 136 three-tier database applications, 215-219 Thunderstone, 8 Time class, 51, 288 Timestamp class, 51, 289-291 tjFM, 33 /tmp/jdbc directory, 107 tokens, identity, 157, 160 Transaction class, 166-169 generic transaction logic (code example), 186-192 transaction isolation, 70 transaction management, 10 EJB (Enterprise JavaBeans), 165-170 TRANSACTION_NONE, 70 TRANSACTION_READ_COMMITTED, 70 TRANSACTION_READ_UNCOMMITTED, 70 TRANSACTION_REPEATABLE_READ, 71 transactions, 23 aborting (see ROLLBACKs) boundaries, 166 deadlocks, 170 distributed, 99-101 exception handling, 167 permanent (see COMMITs) persistence and, 183-193 RMI, no built-in support for, 117 tracking changes to, 167-169, 185 visibility issues, 70 TRANSACTION_SERIALIZABLE, 71 tree components, Swing support for, 215 TreeModel class, 208 three-tier database application, 215 TreeNode implementations, 215 Trifox, Inc., 33 two-phase commits, 165 two-tier architecture, 129-133 fat-client systems, 131 limitations to, 131 object reuse, 132 using Java with, 130 when to use, 133 two-tier database applications, 210-215 type mapping system, JDBC 2.0, 77 TYPE_FORWARD_ONLY result set, 46 type-map object, 77 Types class, 50, 77, 291 TYPE_SCROLL_INSENSITIVE result set, 46, 69 TYPE_SCROLL_SENSITIVE result set, 46, 69 U[ Top ] UI delegates, Swing API, 208 monitoring models for changes, 219-221 UML diagrams, 127 component transactions, 186 composite pattern, 140 distributed listener pattern, 139 mid-tier business objects, 144 unencrypted passwords, 160 UnicastRemoteObject class, 111 providing custom socket factories, 164 Unicode, Java strings, 8 Unified Modeling Language (see UML diagrams) uniform resource locators (see URLs) unique identifiers, distributed components, 149-156, 170-172 unmarshaling, remote method calls, 112 updatable result sets (see result sets, updatable) UPDATE statement, 21 updateRow( ), 68 URLs, 29, 35 binding objects to, 109 RMI (Remote Method Invocation), 109 URL lookups, 111 using JDBC 2.0 Optional Package, 92 user interface, 207-223 accessibility issues, 9 banking application, 145 business objects and, 135 client patterns and, 138 V[ Top ] validation, component security, 161 VARBINARY datatype, 72 VARCHAR datatype, 44, 72 vendors, JDBC driver, 31-33 views (GUI widgets), 208 visibility of changes, updatable result sets, 69-71 Visigenic, 33 W[ Top ] warnings, JDBC, 51 wasNull( ), 41 WHERE clause, 21 Wittgenstein, Ludwig, xvi, 126, 183 worker threads, Swing API, 221-223 WorkerThread object, 221 X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
I[ Top ] IBM, 8, 32 ID generation, 55 sequence generators and, 149-156 Identifier class, 161 identity tokens and authentication, 157, 160 IDL (Interface Definition Language), 7 IDS Software, 32 I-Kinetics, 32 Imaginary, 32 i-net software, 32 Information Builders, 32 Informix Corporation, 8, 32 init( ), 52 initial contexts, JNDI, 107 INSERT statement, 20 insertRow( ), 69 instances, reusing, 132 InterBase, 32 Interface Definition Language (IDL), 7 interfaces home/remote (EJB), 119-122 remote (RMI), 110 internationalization factory classes and, 141 Java built-in support, 8 requirement for enterprise systems, 5 InterSoft, 8, 32 Intersolv, 8, 32 invokeAndWait( ), 209 invokeLater( ), 209 invokeWorker( ), 223 isAfterLast( ), result set position, 49 isBeforeFirst( ), result set position, 49 isFirst( ), result set position, 49 isLast( ), result set position, 49 isolated database connectivity, 133 IteratorEnumeration class, 217 J[ Top ] Java APIs, 6-8 database programming with, 12-14 interacting with databases, 10 null vs. SQL NULL, 40 object types, 76 platform independence, 6-8 servlet example, 51-56 SQL datatypes, mapping, 44-46, 77 Java DataBase Connectivity (see JDBC) Java Naming and Directory Interface (see JNDI) Java Virtual Machine (JVM), 6 zero-install client concept, 12 JavaBeans API, 7 property change events and, 173 result sets and, 96-99 rowsets and, 96-99, 300-314 (see also EJB (Enterprise JavaBeans)) JAVA_OBJECT type, 77 Java-relational DBMS, 76 JavaSoft, 32 JDBC, 7 alternatives to, 33 API for, 10 Core API classes/interfaces, 227-292 DataSource interface, 93, 297 drivers, 31-33 downloading, 30 scrollable result sets, handling, 49 EJB methods and, 124 exception handling, 38 handling NULL values, 54 meta-data classes, 79-91 SQL terminal monitor application, 82-91 persistence operations, 195-206 prepared statements, 57-59 SQL arrays, 75, 227-229 stored procedures, 60-62 structure of, 27-30 support classes, 50 URLs, 29, 35 using JDBC 2.0 Optional Package, 92 vs. ODBC, 26, 34 warnings, 51 JDBC 2.0 features, 24 advanced datatype support, 71-79 batch processing, 62-67 datatype mappings, 45, 77 Optional Package, 92-101, 293-316 connection pooling, 95, 195 distributed transactions, 99-101 naming and directory services, 93, 106, 297 rowsets, 96-99, 300-314 scrollable result sets (see result sets, scrollable) updatable result sets (see result sets, updatable) jdbc.drivers property registering a driver, 36 JDBC-ODBC bridge, 26, 30 JNDI (Java Naming and Directory Interface), 105-108 connection pooling and, 95 contexts, 107 database access, 93, 106 object binding, 106 object lookup, 107, 171 support in EJB, 120 joins (SELECT statements), 22 JTable UI delegate, 210 JTree class, 208 avoiding data overload, 217-219 JVM (Java Virtual Machine), 6 distributed objects and, 108 zero-install client concept, 12 K[ Top ] Kant, Immanuel, xi, xv KonaSoft, Inc., 32 L[ Top ] last( ), 48 LDAP servers, 94 Liberty Integration Software, 32 listener pattern, 138 listeners, distributed (see distributed listener pattern) load( ), persistence delegate pattern and, 143 logical data models, 18 long-lived events executed by worker threads, 221-223 handling, 209 occurring in event queues, 219 lookup, objects EJB (Enterprise JavaBeans), 170-172 JNDI (Java Naming and Directory Interface), 107, 171 RMI (Remote Method Invocation), 117 Lotus Development, 32 M[ Top ] Management API, 7 marshaling, remote method calls, 112 Media API, 7 Media Frameworks API, 7 Memento class, 194 memento pattern, 143 separating business logic and persistence logic, 194 meta-data classes, JDBC, 79-91 SQL terminal monitor application, 82-91 mid-tier business objects, 134-136 model objects (GUI components), 208 event handling, 209-211 model-delegate pattern, 138, 208 models, database application, 210-219 model-view-controller (MVC) pattern, 138, 208 modification state, 185 moveToCurrentRow( ), 69 moveToInsertRow( ), 69 MsqlDataSource class, 94 mSQL-JDBC driver, 27 JDBC URL for, 30 multithreading, Swing API, 209 MVC (model-view-controller) pattern, 138, 208 N[ Top ] NAA (Network Application Architecture), 136 banking application, 143 Naming class, 111 naming services, 93, 106 DataSource interface, 297 Naming.rebind( ), 109 NetAway, 32 Network Application Architecture (NAA), 136 banking application, 143 network security, 162-164 next( ), 40, 47-49 Nietzsche, Friedrich, xvi, 92 node identifiers, ID generation, 149-152 nodes, root, 215-219 Nogginware Corporation, 33 nonremote objects, passing, 114-116 n-tier architecture (see three-tier architecture) null values, SQL NULL vs. Java null, 40 O[ Top ] object databases, 11 Object Design, 8 Object Management Group (OMG) IDL specification, 7 object serialization, 114-116 object servers, accessing remote objects, 109, 113 object-relational databases, 11 objects binding (JNDI), 106 exporting, 111 lookup EJB, 170-172 JNDI, 107, 171 RMI, 117 modification state of, 185 passing nonremote, 114-116 remote (see RMI) reuse of, 132 ODBC (Open DataBase Connectivity) vs. JDBC, 26, 34 ODBC-JDBC bridge, 26, 30 OMG (Object Management Group) IDL specification, 7 Open DataBase Connectivity (ODBC) vs. JDBC, 26, 34 Open Horizon, 8 OpenLink Software, 8, 33 optimistic concurrency mode, 197 Optional Package (see JDBC 2.0 features, Optional Package) Oracle Corporation, 8, 33 P[ Top ] parameters, binding, 58 passwords, unencrypted, 160 patterns, design, 137-143 business, 140-142 client, 138 composite, 140 data access, 142 distributed listener (see distributed listener pattern) factory, 141 custom client socket factory, 163 listener, 138 memento, 143, 194 model-delegate, 138, 208 model-view-controller (MVC), 138, 208 persistence delegate (see persistence delegate pattern) permanent transactions (see COMMITs) persistence, 183-206 banking application, 144 bean-managed, 124, 147 container-managed, drawbacks of, 124, 147 database transactions and, 183-193 impartiality needed for component model, 184 key behaviors of, 185 modification state, 185 of objects, 142, 185 RMI, no built-in support for, 117 search support, 197-206 separating business logic and persistence logic, 193 using design patterns, 194 persistence delegate pattern, 142 interface behaviors, 143 JDBC persistence, 196 search support, 197 separating business logic and persistence logic, 194 persistence library architecture of, 184 searching for objects using, 170 using JDBC classes, 195 Persistence Software, 8 PersistenceSupport interface, 194, 197 persistent components, 148-156 (see also entity beans) pessimistic concurrency mode, 197 phantom reads, 70 physical data models, 18 platform independence, Java, 6-8 polling threads, 221 PooledConnection interface, 298 pooling, connection, 95, 195, 296 portability date handling, 51 stored procedures and, 61 prepareCall( ), 61 prepared statements, 57-59 vs. stored procedures, 63 PreparedStatement class, 58, 255-258 batch processing, 64 Blob/Clob objects and, 73 when to use, 63 prepareStatement( ), 59 prepareUpdate( ), 168, 185 Presence Information Design, 8 previous( ), 47-49 primary keys, entity beans, 121, 148 printComments( ), 53 Pro-C Ltd., 8 process-oriented components, 148 (see also session beans) processResults( ), 87 methods used by, 88 properties file, for JDBC configuration, 37 PropertyChangeEvent, 173 distributed listeners and, 220 PropertyChangeListener, 220 PropertyChangeListener interface, 139 provider, EJB, 118 Q[ Top ] queries, 39-43 ResultSet class and, 40 subqueries, 22 (see also SELECT statement) query plans, building, 57-59 quotation marks, 19 R[ Top ] rebind( ), 109 Recital Corporation, 8, 33 reconnect( ), 173-181, 221 Ref class, 76, 259 REF type (SQL), 76 refreshRow( ), 71 registerOutParameter( ), 62 relational databases, 11, 15-19 object persistence and, 142 relative( ), 48 Remote interface, 110, 119 remote interfaces EJB (Enterprise JavaBeans), 119-122 RMI (Remote Method Invocation), 110 remote method calls marshaling/unmarshaling, 112 RemoteException, 113 skeletons/stubs, 112 Remote Method Invocation (see RMI) remote objects (see RMI) RemoteException, 113 remove( ), persistence delegate pattern and, 143 repeatable reads, 70 ResourceBundle class, 141 result set concurrency, 46, 67 result sets navigation of, 47-49 rowsets and, 96-99, 300-314 scrollable, 46-50 optimization of, 49 transaction isolation, 70 types, 46 updatable, 67-71 deleting values, 69 getting the latest data, 71 inserting new rows, 69 updating values, 68 using batch processing instead, 68 visibility of changes in, 69-71 ResultSet class, 259-273 queries and, 40 ResultSetMetaData class and, 79-81 rowsets and, 97 scrollable result sets, 46-50 ResultSetMetaData class, 79-81, 273-277 reuse of objects, 132 of source code, 132 RMI (Remote Method Invocation), 7 accessing remote objects, 13, 109, 113 application servers, 114 binding objects to URLs, 109 creating remote interfaces, 110 distributed computing support, 9 encrypting network communications, 162-164 exporting objects, 111 marshaling/unmarshaling, 112 object servers, 113 shortcomings of, 116 skeletons/stubs, 112 structure of, 108-113 vs. CORBA, 108 vs. EJB (Enterprise JavaBeans), 116 rmic (RMI compiler) command, 111 RogueWave Software, 8 rollback( ), 170 JDBC transactions, 193 ROLLBACKs, 23 mSQL and, 30 root nodes, 215-219 RootNode class (code example), 215-217 RowSet interface, 97-99, 300-306 constructing a model for database access, 211-215 RowSetEvent class, 306 RowSetInternal interface, 307 RowSetListener interface, 98, 308 RowSetMetaData interface, 309-312 RowSetReader interface, 313 rowsets, 96-99, 300-314 JavaBeans events, 98 RowSetWriter interface, 313 rules (see business rules) run( ), 209 S[ Top ] Sartre, Jean-Paul, xvi, 207 SAS Institute Inc., 8, 33 save( ), 220 SCO, 8, 33 scrollable result sets (see result sets, scrollable) SearchBinding class, 171 SearchCriteria class, 171, 205 searching for objects (see lookup, objects) using the persistence delegate, 197-206 secure socket layer (SSL) sockets, 162 Security API, 8 security issues components authentication, 156-161 identity tokens, 157, 160 unencrypted passwords, 160 validation, 161 databases, 164 distributed systems, 156-164, 167-169 networks, 162-164 RMI (Remote Method Invocation), 116 SELECT statement, 22, 39-43 (see also queries) sequence generators, ID generation, 149-156 SequenceGenerator class, code examples, 150-152, 153-156 Serializable interface, 115 serialization, object, 114-116 Server API, 8 server provider, EJB, 118 service providers, JNDI, 106 servlets, Java, 8 session beans, 119 (see also process-oriented components) SessionBean method, 121 setAutoCommit( ), 42 setBlob( ), 73 setClob( ), 73 setFetchDirection( ), 49 setFetchSize( ), 49 setString( ), 76 Simba Technologies, Inc., 33 single quotation marks ('), 19 skeletons and remote method calls, 112 Socket class, 162 sockets, 162-164 custom socket factories, 162 Software AG, 33 Solid Information Technology, 33 source code reuse, 132 special exception, remote methods, 113 SQL language, 10, 19-23 arrays, 75, 227-229 Java datatypes, mapping, 44-46, 77 NULL vs. Java null, 40 prepared statements, 57-59 SQL2, 23 datatype support, 44, 71 SQL3, 24 array objects, 227-229 datatype mappings, 45 datatype support, 76 structured types, 287 SQL/92, 23 stored procedures, 60-62 transaction logic, 23 VARCHAR datatype, 44 SQLData class, 277 SQLException class, 50 SQLInput class, 279 SQLJ paradigm, 34 SQLOutput class, 280-282 SQLWarning class, 51 SSL (secure socket layer) sockets, 162 StarQuest Software, 33 Statement class, 39, 282-287 batch processing, 64 execute( ) and, 80 PreparedStatement interface and, 58 when to use, 63 store( ), persistence delegate pattern and, 143, 196 stored procedures, 10, 60-62 vs. prepared statements, 63 Struct class, 76, 287 STRUCT type (SQL), 76 stubs and remote method calls, 112 subqueries, 22 Support class (full source code), 197-205 support classes, 50 Swing API, 138, 208-223 distributed listeners, 219-221 event queues, 209 handling long-lived events, 209 model-delegate architecture, 208 multithreading in, 209 MVC (model-view-controller), 208 three-tier database applications, 215-219 tree component support, 215 two-tier database application, 210-215 UI delegates, 208 monitoring models for changes, 219-221 worker threads, 221-223 SwingUtilities class, 209 Sybase, 8, 33 Symantec, 8, 33 system administrator, EJB, 118 T[ Top ] TableModel mode, 211 Telephony API, 8 ThinWeb SoftWare, 33 threads, Swing API, 209 three-tier architecture, 133-136 banking application, 143 centralized data processing, 134 data presentation, 135 drawbacks to, 136 Network Application Architecture, 136 three-tier database applications, 215-219 Thunderstone, 8 Time class, 51, 288 Timestamp class, 51, 289-291 tjFM, 33 /tmp/jdbc directory, 107 tokens, identity, 157, 160 Transaction class, 166-169 generic transaction logic (code example), 186-192 transaction isolation, 70 transaction management, 10 EJB (Enterprise JavaBeans), 165-170 TRANSACTION_NONE, 70 TRANSACTION_READ_COMMITTED, 70 TRANSACTION_READ_UNCOMMITTED, 70 TRANSACTION_REPEATABLE_READ, 71 transactions, 23 aborting (see ROLLBACKs) boundaries, 166 deadlocks, 170 distributed, 99-101 exception handling, 167 permanent (see COMMITs) persistence and, 183-193 RMI, no built-in support for, 117 tracking changes to, 167-169, 185 visibility issues, 70 TRANSACTION_SERIALIZABLE, 71 tree components, Swing support for, 215 TreeModel class, 208 three-tier database application, 215 TreeNode implementations, 215 Trifox, Inc., 33 two-phase commits, 165 two-tier architecture, 129-133 fat-client systems, 131 limitations to, 131 object reuse, 132 using Java with, 130 when to use, 133 two-tier database applications, 210-215 type mapping system, JDBC 2.0, 77 TYPE_FORWARD_ONLY result set, 46 type-map object, 77 Types class, 50, 77, 291 TYPE_SCROLL_INSENSITIVE result set, 46, 69 TYPE_SCROLL_SENSITIVE result set, 46, 69 U[ Top ] UI delegates, Swing API, 208 monitoring models for changes, 219-221 UML diagrams, 127 component transactions, 186 composite pattern, 140 distributed listener pattern, 139 mid-tier business objects, 144 unencrypted passwords, 160 UnicastRemoteObject class, 111 providing custom socket factories, 164 Unicode, Java strings, 8 Unified Modeling Language (see UML diagrams) uniform resource locators (see URLs) unique identifiers, distributed components, 149-156, 170-172 unmarshaling, remote method calls, 112 updatable result sets (see result sets, updatable) UPDATE statement, 21 updateRow( ), 68 URLs, 29, 35 binding objects to, 109 RMI (Remote Method Invocation), 109 URL lookups, 111 using JDBC 2.0 Optional Package, 92 user interface, 207-223 accessibility issues, 9 banking application, 145 business objects and, 135 client patterns and, 138 V[ Top ] validation, component security, 161 VARBINARY datatype, 72 VARCHAR datatype, 44, 72 vendors, JDBC driver, 31-33 views (GUI widgets), 208 visibility of changes, updatable result sets, 69-71 Visigenic, 33 W[ Top ] warnings, JDBC, 51 wasNull( ), 41 WHERE clause, 21 Wittgenstein, Ludwig, xvi, 126, 183 worker threads, Swing API, 221-223 WorkerThread object, 221 X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
J[ Top ] Java APIs, 6-8 database programming with, 12-14 interacting with databases, 10 null vs. SQL NULL, 40 object types, 76 platform independence, 6-8 servlet example, 51-56 SQL datatypes, mapping, 44-46, 77 Java DataBase Connectivity (see JDBC) Java Naming and Directory Interface (see JNDI) Java Virtual Machine (JVM), 6 zero-install client concept, 12 JavaBeans API, 7 property change events and, 173 result sets and, 96-99 rowsets and, 96-99, 300-314 (see also EJB (Enterprise JavaBeans)) JAVA_OBJECT type, 77 Java-relational DBMS, 76 JavaSoft, 32 JDBC, 7 alternatives to, 33 API for, 10 Core API classes/interfaces, 227-292 DataSource interface, 93, 297 drivers, 31-33 downloading, 30 scrollable result sets, handling, 49 EJB methods and, 124 exception handling, 38 handling NULL values, 54 meta-data classes, 79-91 SQL terminal monitor application, 82-91 persistence operations, 195-206 prepared statements, 57-59 SQL arrays, 75, 227-229 stored procedures, 60-62 structure of, 27-30 support classes, 50 URLs, 29, 35 using JDBC 2.0 Optional Package, 92 vs. ODBC, 26, 34 warnings, 51 JDBC 2.0 features, 24 advanced datatype support, 71-79 batch processing, 62-67 datatype mappings, 45, 77 Optional Package, 92-101, 293-316 connection pooling, 95, 195 distributed transactions, 99-101 naming and directory services, 93, 106, 297 rowsets, 96-99, 300-314 scrollable result sets (see result sets, scrollable) updatable result sets (see result sets, updatable) jdbc.drivers property registering a driver, 36 JDBC-ODBC bridge, 26, 30 JNDI (Java Naming and Directory Interface), 105-108 connection pooling and, 95 contexts, 107 database access, 93, 106 object binding, 106 object lookup, 107, 171 support in EJB, 120 joins (SELECT statements), 22 JTable UI delegate, 210 JTree class, 208 avoiding data overload, 217-219 JVM (Java Virtual Machine), 6 distributed objects and, 108 zero-install client concept, 12 K[ Top ] Kant, Immanuel, xi, xv KonaSoft, Inc., 32 L[ Top ] last( ), 48 LDAP servers, 94 Liberty Integration Software, 32 listener pattern, 138 listeners, distributed (see distributed listener pattern) load( ), persistence delegate pattern and, 143 logical data models, 18 long-lived events executed by worker threads, 221-223 handling, 209 occurring in event queues, 219 lookup, objects EJB (Enterprise JavaBeans), 170-172 JNDI (Java Naming and Directory Interface), 107, 171 RMI (Remote Method Invocation), 117 Lotus Development, 32 M[ Top ] Management API, 7 marshaling, remote method calls, 112 Media API, 7 Media Frameworks API, 7 Memento class, 194 memento pattern, 143 separating business logic and persistence logic, 194 meta-data classes, JDBC, 79-91 SQL terminal monitor application, 82-91 mid-tier business objects, 134-136 model objects (GUI components), 208 event handling, 209-211 model-delegate pattern, 138, 208 models, database application, 210-219 model-view-controller (MVC) pattern, 138, 208 modification state, 185 moveToCurrentRow( ), 69 moveToInsertRow( ), 69 MsqlDataSource class, 94 mSQL-JDBC driver, 27 JDBC URL for, 30 multithreading, Swing API, 209 MVC (model-view-controller) pattern, 138, 208 N[ Top ] NAA (Network Application Architecture), 136 banking application, 143 Naming class, 111 naming services, 93, 106 DataSource interface, 297 Naming.rebind( ), 109 NetAway, 32 Network Application Architecture (NAA), 136 banking application, 143 network security, 162-164 next( ), 40, 47-49 Nietzsche, Friedrich, xvi, 92 node identifiers, ID generation, 149-152 nodes, root, 215-219 Nogginware Corporation, 33 nonremote objects, passing, 114-116 n-tier architecture (see three-tier architecture) null values, SQL NULL vs. Java null, 40 O[ Top ] object databases, 11 Object Design, 8 Object Management Group (OMG) IDL specification, 7 object serialization, 114-116 object servers, accessing remote objects, 109, 113 object-relational databases, 11 objects binding (JNDI), 106 exporting, 111 lookup EJB, 170-172 JNDI, 107, 171 RMI, 117 modification state of, 185 passing nonremote, 114-116 remote (see RMI) reuse of, 132 ODBC (Open DataBase Connectivity) vs. JDBC, 26, 34 ODBC-JDBC bridge, 26, 30 OMG (Object Management Group) IDL specification, 7 Open DataBase Connectivity (ODBC) vs. JDBC, 26, 34 Open Horizon, 8 OpenLink Software, 8, 33 optimistic concurrency mode, 197 Optional Package (see JDBC 2.0 features, Optional Package) Oracle Corporation, 8, 33 P[ Top ] parameters, binding, 58 passwords, unencrypted, 160 patterns, design, 137-143 business, 140-142 client, 138 composite, 140 data access, 142 distributed listener (see distributed listener pattern) factory, 141 custom client socket factory, 163 listener, 138 memento, 143, 194 model-delegate, 138, 208 model-view-controller (MVC), 138, 208 persistence delegate (see persistence delegate pattern) permanent transactions (see COMMITs) persistence, 183-206 banking application, 144 bean-managed, 124, 147 container-managed, drawbacks of, 124, 147 database transactions and, 183-193 impartiality needed for component model, 184 key behaviors of, 185 modification state, 185 of objects, 142, 185 RMI, no built-in support for, 117 search support, 197-206 separating business logic and persistence logic, 193 using design patterns, 194 persistence delegate pattern, 142 interface behaviors, 143 JDBC persistence, 196 search support, 197 separating business logic and persistence logic, 194 persistence library architecture of, 184 searching for objects using, 170 using JDBC classes, 195 Persistence Software, 8 PersistenceSupport interface, 194, 197 persistent components, 148-156 (see also entity beans) pessimistic concurrency mode, 197 phantom reads, 70 physical data models, 18 platform independence, Java, 6-8 polling threads, 221 PooledConnection interface, 298 pooling, connection, 95, 195, 296 portability date handling, 51 stored procedures and, 61 prepareCall( ), 61 prepared statements, 57-59 vs. stored procedures, 63 PreparedStatement class, 58, 255-258 batch processing, 64 Blob/Clob objects and, 73 when to use, 63 prepareStatement( ), 59 prepareUpdate( ), 168, 185 Presence Information Design, 8 previous( ), 47-49 primary keys, entity beans, 121, 148 printComments( ), 53 Pro-C Ltd., 8 process-oriented components, 148 (see also session beans) processResults( ), 87 methods used by, 88 properties file, for JDBC configuration, 37 PropertyChangeEvent, 173 distributed listeners and, 220 PropertyChangeListener, 220 PropertyChangeListener interface, 139 provider, EJB, 118 Q[ Top ] queries, 39-43 ResultSet class and, 40 subqueries, 22 (see also SELECT statement) query plans, building, 57-59 quotation marks, 19 R[ Top ] rebind( ), 109 Recital Corporation, 8, 33 reconnect( ), 173-181, 221 Ref class, 76, 259 REF type (SQL), 76 refreshRow( ), 71 registerOutParameter( ), 62 relational databases, 11, 15-19 object persistence and, 142 relative( ), 48 Remote interface, 110, 119 remote interfaces EJB (Enterprise JavaBeans), 119-122 RMI (Remote Method Invocation), 110 remote method calls marshaling/unmarshaling, 112 RemoteException, 113 skeletons/stubs, 112 Remote Method Invocation (see RMI) remote objects (see RMI) RemoteException, 113 remove( ), persistence delegate pattern and, 143 repeatable reads, 70 ResourceBundle class, 141 result set concurrency, 46, 67 result sets navigation of, 47-49 rowsets and, 96-99, 300-314 scrollable, 46-50 optimization of, 49 transaction isolation, 70 types, 46 updatable, 67-71 deleting values, 69 getting the latest data, 71 inserting new rows, 69 updating values, 68 using batch processing instead, 68 visibility of changes in, 69-71 ResultSet class, 259-273 queries and, 40 ResultSetMetaData class and, 79-81 rowsets and, 97 scrollable result sets, 46-50 ResultSetMetaData class, 79-81, 273-277 reuse of objects, 132 of source code, 132 RMI (Remote Method Invocation), 7 accessing remote objects, 13, 109, 113 application servers, 114 binding objects to URLs, 109 creating remote interfaces, 110 distributed computing support, 9 encrypting network communications, 162-164 exporting objects, 111 marshaling/unmarshaling, 112 object servers, 113 shortcomings of, 116 skeletons/stubs, 112 structure of, 108-113 vs. CORBA, 108 vs. EJB (Enterprise JavaBeans), 116 rmic (RMI compiler) command, 111 RogueWave Software, 8 rollback( ), 170 JDBC transactions, 193 ROLLBACKs, 23 mSQL and, 30 root nodes, 215-219 RootNode class (code example), 215-217 RowSet interface, 97-99, 300-306 constructing a model for database access, 211-215 RowSetEvent class, 306 RowSetInternal interface, 307 RowSetListener interface, 98, 308 RowSetMetaData interface, 309-312 RowSetReader interface, 313 rowsets, 96-99, 300-314 JavaBeans events, 98 RowSetWriter interface, 313 rules (see business rules) run( ), 209 S[ Top ] Sartre, Jean-Paul, xvi, 207 SAS Institute Inc., 8, 33 save( ), 220 SCO, 8, 33 scrollable result sets (see result sets, scrollable) SearchBinding class, 171 SearchCriteria class, 171, 205 searching for objects (see lookup, objects) using the persistence delegate, 197-206 secure socket layer (SSL) sockets, 162 Security API, 8 security issues components authentication, 156-161 identity tokens, 157, 160 unencrypted passwords, 160 validation, 161 databases, 164 distributed systems, 156-164, 167-169 networks, 162-164 RMI (Remote Method Invocation), 116 SELECT statement, 22, 39-43 (see also queries) sequence generators, ID generation, 149-156 SequenceGenerator class, code examples, 150-152, 153-156 Serializable interface, 115 serialization, object, 114-116 Server API, 8 server provider, EJB, 118 service providers, JNDI, 106 servlets, Java, 8 session beans, 119 (see also process-oriented components) SessionBean method, 121 setAutoCommit( ), 42 setBlob( ), 73 setClob( ), 73 setFetchDirection( ), 49 setFetchSize( ), 49 setString( ), 76 Simba Technologies, Inc., 33 single quotation marks ('), 19 skeletons and remote method calls, 112 Socket class, 162 sockets, 162-164 custom socket factories, 162 Software AG, 33 Solid Information Technology, 33 source code reuse, 132 special exception, remote methods, 113 SQL language, 10, 19-23 arrays, 75, 227-229 Java datatypes, mapping, 44-46, 77 NULL vs. Java null, 40 prepared statements, 57-59 SQL2, 23 datatype support, 44, 71 SQL3, 24 array objects, 227-229 datatype mappings, 45 datatype support, 76 structured types, 287 SQL/92, 23 stored procedures, 60-62 transaction logic, 23 VARCHAR datatype, 44 SQLData class, 277 SQLException class, 50 SQLInput class, 279 SQLJ paradigm, 34 SQLOutput class, 280-282 SQLWarning class, 51 SSL (secure socket layer) sockets, 162 StarQuest Software, 33 Statement class, 39, 282-287 batch processing, 64 execute( ) and, 80 PreparedStatement interface and, 58 when to use, 63 store( ), persistence delegate pattern and, 143, 196 stored procedures, 10, 60-62 vs. prepared statements, 63 Struct class, 76, 287 STRUCT type (SQL), 76 stubs and remote method calls, 112 subqueries, 22 Support class (full source code), 197-205 support classes, 50 Swing API, 138, 208-223 distributed listeners, 219-221 event queues, 209 handling long-lived events, 209 model-delegate architecture, 208 multithreading in, 209 MVC (model-view-controller), 208 three-tier database applications, 215-219 tree component support, 215 two-tier database application, 210-215 UI delegates, 208 monitoring models for changes, 219-221 worker threads, 221-223 SwingUtilities class, 209 Sybase, 8, 33 Symantec, 8, 33 system administrator, EJB, 118 T[ Top ] TableModel mode, 211 Telephony API, 8 ThinWeb SoftWare, 33 threads, Swing API, 209 three-tier architecture, 133-136 banking application, 143 centralized data processing, 134 data presentation, 135 drawbacks to, 136 Network Application Architecture, 136 three-tier database applications, 215-219 Thunderstone, 8 Time class, 51, 288 Timestamp class, 51, 289-291 tjFM, 33 /tmp/jdbc directory, 107 tokens, identity, 157, 160 Transaction class, 166-169 generic transaction logic (code example), 186-192 transaction isolation, 70 transaction management, 10 EJB (Enterprise JavaBeans), 165-170 TRANSACTION_NONE, 70 TRANSACTION_READ_COMMITTED, 70 TRANSACTION_READ_UNCOMMITTED, 70 TRANSACTION_REPEATABLE_READ, 71 transactions, 23 aborting (see ROLLBACKs) boundaries, 166 deadlocks, 170 distributed, 99-101 exception handling, 167 permanent (see COMMITs) persistence and, 183-193 RMI, no built-in support for, 117 tracking changes to, 167-169, 185 visibility issues, 70 TRANSACTION_SERIALIZABLE, 71 tree components, Swing support for, 215 TreeModel class, 208 three-tier database application, 215 TreeNode implementations, 215 Trifox, Inc., 33 two-phase commits, 165 two-tier architecture, 129-133 fat-client systems, 131 limitations to, 131 object reuse, 132 using Java with, 130 when to use, 133 two-tier database applications, 210-215 type mapping system, JDBC 2.0, 77 TYPE_FORWARD_ONLY result set, 46 type-map object, 77 Types class, 50, 77, 291 TYPE_SCROLL_INSENSITIVE result set, 46, 69 TYPE_SCROLL_SENSITIVE result set, 46, 69 U[ Top ] UI delegates, Swing API, 208 monitoring models for changes, 219-221 UML diagrams, 127 component transactions, 186 composite pattern, 140 distributed listener pattern, 139 mid-tier business objects, 144 unencrypted passwords, 160 UnicastRemoteObject class, 111 providing custom socket factories, 164 Unicode, Java strings, 8 Unified Modeling Language (see UML diagrams) uniform resource locators (see URLs) unique identifiers, distributed components, 149-156, 170-172 unmarshaling, remote method calls, 112 updatable result sets (see result sets, updatable) UPDATE statement, 21 updateRow( ), 68 URLs, 29, 35 binding objects to, 109 RMI (Remote Method Invocation), 109 URL lookups, 111 using JDBC 2.0 Optional Package, 92 user interface, 207-223 accessibility issues, 9 banking application, 145 business objects and, 135 client patterns and, 138 V[ Top ] validation, component security, 161 VARBINARY datatype, 72 VARCHAR datatype, 44, 72 vendors, JDBC driver, 31-33 views (GUI widgets), 208 visibility of changes, updatable result sets, 69-71 Visigenic, 33 W[ Top ] warnings, JDBC, 51 wasNull( ), 41 WHERE clause, 21 Wittgenstein, Ludwig, xvi, 126, 183 worker threads, Swing API, 221-223 WorkerThread object, 221 X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
K[ Top ] Kant, Immanuel, xi, xv KonaSoft, Inc., 32 L[ Top ] last( ), 48 LDAP servers, 94 Liberty Integration Software, 32 listener pattern, 138 listeners, distributed (see distributed listener pattern) load( ), persistence delegate pattern and, 143 logical data models, 18 long-lived events executed by worker threads, 221-223 handling, 209 occurring in event queues, 219 lookup, objects EJB (Enterprise JavaBeans), 170-172 JNDI (Java Naming and Directory Interface), 107, 171 RMI (Remote Method Invocation), 117 Lotus Development, 32 M[ Top ] Management API, 7 marshaling, remote method calls, 112 Media API, 7 Media Frameworks API, 7 Memento class, 194 memento pattern, 143 separating business logic and persistence logic, 194 meta-data classes, JDBC, 79-91 SQL terminal monitor application, 82-91 mid-tier business objects, 134-136 model objects (GUI components), 208 event handling, 209-211 model-delegate pattern, 138, 208 models, database application, 210-219 model-view-controller (MVC) pattern, 138, 208 modification state, 185 moveToCurrentRow( ), 69 moveToInsertRow( ), 69 MsqlDataSource class, 94 mSQL-JDBC driver, 27 JDBC URL for, 30 multithreading, Swing API, 209 MVC (model-view-controller) pattern, 138, 208 N[ Top ] NAA (Network Application Architecture), 136 banking application, 143 Naming class, 111 naming services, 93, 106 DataSource interface, 297 Naming.rebind( ), 109 NetAway, 32 Network Application Architecture (NAA), 136 banking application, 143 network security, 162-164 next( ), 40, 47-49 Nietzsche, Friedrich, xvi, 92 node identifiers, ID generation, 149-152 nodes, root, 215-219 Nogginware Corporation, 33 nonremote objects, passing, 114-116 n-tier architecture (see three-tier architecture) null values, SQL NULL vs. Java null, 40 O[ Top ] object databases, 11 Object Design, 8 Object Management Group (OMG) IDL specification, 7 object serialization, 114-116 object servers, accessing remote objects, 109, 113 object-relational databases, 11 objects binding (JNDI), 106 exporting, 111 lookup EJB, 170-172 JNDI, 107, 171 RMI, 117 modification state of, 185 passing nonremote, 114-116 remote (see RMI) reuse of, 132 ODBC (Open DataBase Connectivity) vs. JDBC, 26, 34 ODBC-JDBC bridge, 26, 30 OMG (Object Management Group) IDL specification, 7 Open DataBase Connectivity (ODBC) vs. JDBC, 26, 34 Open Horizon, 8 OpenLink Software, 8, 33 optimistic concurrency mode, 197 Optional Package (see JDBC 2.0 features, Optional Package) Oracle Corporation, 8, 33 P[ Top ] parameters, binding, 58 passwords, unencrypted, 160 patterns, design, 137-143 business, 140-142 client, 138 composite, 140 data access, 142 distributed listener (see distributed listener pattern) factory, 141 custom client socket factory, 163 listener, 138 memento, 143, 194 model-delegate, 138, 208 model-view-controller (MVC), 138, 208 persistence delegate (see persistence delegate pattern) permanent transactions (see COMMITs) persistence, 183-206 banking application, 144 bean-managed, 124, 147 container-managed, drawbacks of, 124, 147 database transactions and, 183-193 impartiality needed for component model, 184 key behaviors of, 185 modification state, 185 of objects, 142, 185 RMI, no built-in support for, 117 search support, 197-206 separating business logic and persistence logic, 193 using design patterns, 194 persistence delegate pattern, 142 interface behaviors, 143 JDBC persistence, 196 search support, 197 separating business logic and persistence logic, 194 persistence library architecture of, 184 searching for objects using, 170 using JDBC classes, 195 Persistence Software, 8 PersistenceSupport interface, 194, 197 persistent components, 148-156 (see also entity beans) pessimistic concurrency mode, 197 phantom reads, 70 physical data models, 18 platform independence, Java, 6-8 polling threads, 221 PooledConnection interface, 298 pooling, connection, 95, 195, 296 portability date handling, 51 stored procedures and, 61 prepareCall( ), 61 prepared statements, 57-59 vs. stored procedures, 63 PreparedStatement class, 58, 255-258 batch processing, 64 Blob/Clob objects and, 73 when to use, 63 prepareStatement( ), 59 prepareUpdate( ), 168, 185 Presence Information Design, 8 previous( ), 47-49 primary keys, entity beans, 121, 148 printComments( ), 53 Pro-C Ltd., 8 process-oriented components, 148 (see also session beans) processResults( ), 87 methods used by, 88 properties file, for JDBC configuration, 37 PropertyChangeEvent, 173 distributed listeners and, 220 PropertyChangeListener, 220 PropertyChangeListener interface, 139 provider, EJB, 118 Q[ Top ] queries, 39-43 ResultSet class and, 40 subqueries, 22 (see also SELECT statement) query plans, building, 57-59 quotation marks, 19 R[ Top ] rebind( ), 109 Recital Corporation, 8, 33 reconnect( ), 173-181, 221 Ref class, 76, 259 REF type (SQL), 76 refreshRow( ), 71 registerOutParameter( ), 62 relational databases, 11, 15-19 object persistence and, 142 relative( ), 48 Remote interface, 110, 119 remote interfaces EJB (Enterprise JavaBeans), 119-122 RMI (Remote Method Invocation), 110 remote method calls marshaling/unmarshaling, 112 RemoteException, 113 skeletons/stubs, 112 Remote Method Invocation (see RMI) remote objects (see RMI) RemoteException, 113 remove( ), persistence delegate pattern and, 143 repeatable reads, 70 ResourceBundle class, 141 result set concurrency, 46, 67 result sets navigation of, 47-49 rowsets and, 96-99, 300-314 scrollable, 46-50 optimization of, 49 transaction isolation, 70 types, 46 updatable, 67-71 deleting values, 69 getting the latest data, 71 inserting new rows, 69 updating values, 68 using batch processing instead, 68 visibility of changes in, 69-71 ResultSet class, 259-273 queries and, 40 ResultSetMetaData class and, 79-81 rowsets and, 97 scrollable result sets, 46-50 ResultSetMetaData class, 79-81, 273-277 reuse of objects, 132 of source code, 132 RMI (Remote Method Invocation), 7 accessing remote objects, 13, 109, 113 application servers, 114 binding objects to URLs, 109 creating remote interfaces, 110 distributed computing support, 9 encrypting network communications, 162-164 exporting objects, 111 marshaling/unmarshaling, 112 object servers, 113 shortcomings of, 116 skeletons/stubs, 112 structure of, 108-113 vs. CORBA, 108 vs. EJB (Enterprise JavaBeans), 116 rmic (RMI compiler) command, 111 RogueWave Software, 8 rollback( ), 170 JDBC transactions, 193 ROLLBACKs, 23 mSQL and, 30 root nodes, 215-219 RootNode class (code example), 215-217 RowSet interface, 97-99, 300-306 constructing a model for database access, 211-215 RowSetEvent class, 306 RowSetInternal interface, 307 RowSetListener interface, 98, 308 RowSetMetaData interface, 309-312 RowSetReader interface, 313 rowsets, 96-99, 300-314 JavaBeans events, 98 RowSetWriter interface, 313 rules (see business rules) run( ), 209 S[ Top ] Sartre, Jean-Paul, xvi, 207 SAS Institute Inc., 8, 33 save( ), 220 SCO, 8, 33 scrollable result sets (see result sets, scrollable) SearchBinding class, 171 SearchCriteria class, 171, 205 searching for objects (see lookup, objects) using the persistence delegate, 197-206 secure socket layer (SSL) sockets, 162 Security API, 8 security issues components authentication, 156-161 identity tokens, 157, 160 unencrypted passwords, 160 validation, 161 databases, 164 distributed systems, 156-164, 167-169 networks, 162-164 RMI (Remote Method Invocation), 116 SELECT statement, 22, 39-43 (see also queries) sequence generators, ID generation, 149-156 SequenceGenerator class, code examples, 150-152, 153-156 Serializable interface, 115 serialization, object, 114-116 Server API, 8 server provider, EJB, 118 service providers, JNDI, 106 servlets, Java, 8 session beans, 119 (see also process-oriented components) SessionBean method, 121 setAutoCommit( ), 42 setBlob( ), 73 setClob( ), 73 setFetchDirection( ), 49 setFetchSize( ), 49 setString( ), 76 Simba Technologies, Inc., 33 single quotation marks ('), 19 skeletons and remote method calls, 112 Socket class, 162 sockets, 162-164 custom socket factories, 162 Software AG, 33 Solid Information Technology, 33 source code reuse, 132 special exception, remote methods, 113 SQL language, 10, 19-23 arrays, 75, 227-229 Java datatypes, mapping, 44-46, 77 NULL vs. Java null, 40 prepared statements, 57-59 SQL2, 23 datatype support, 44, 71 SQL3, 24 array objects, 227-229 datatype mappings, 45 datatype support, 76 structured types, 287 SQL/92, 23 stored procedures, 60-62 transaction logic, 23 VARCHAR datatype, 44 SQLData class, 277 SQLException class, 50 SQLInput class, 279 SQLJ paradigm, 34 SQLOutput class, 280-282 SQLWarning class, 51 SSL (secure socket layer) sockets, 162 StarQuest Software, 33 Statement class, 39, 282-287 batch processing, 64 execute( ) and, 80 PreparedStatement interface and, 58 when to use, 63 store( ), persistence delegate pattern and, 143, 196 stored procedures, 10, 60-62 vs. prepared statements, 63 Struct class, 76, 287 STRUCT type (SQL), 76 stubs and remote method calls, 112 subqueries, 22 Support class (full source code), 197-205 support classes, 50 Swing API, 138, 208-223 distributed listeners, 219-221 event queues, 209 handling long-lived events, 209 model-delegate architecture, 208 multithreading in, 209 MVC (model-view-controller), 208 three-tier database applications, 215-219 tree component support, 215 two-tier database application, 210-215 UI delegates, 208 monitoring models for changes, 219-221 worker threads, 221-223 SwingUtilities class, 209 Sybase, 8, 33 Symantec, 8, 33 system administrator, EJB, 118 T[ Top ] TableModel mode, 211 Telephony API, 8 ThinWeb SoftWare, 33 threads, Swing API, 209 three-tier architecture, 133-136 banking application, 143 centralized data processing, 134 data presentation, 135 drawbacks to, 136 Network Application Architecture, 136 three-tier database applications, 215-219 Thunderstone, 8 Time class, 51, 288 Timestamp class, 51, 289-291 tjFM, 33 /tmp/jdbc directory, 107 tokens, identity, 157, 160 Transaction class, 166-169 generic transaction logic (code example), 186-192 transaction isolation, 70 transaction management, 10 EJB (Enterprise JavaBeans), 165-170 TRANSACTION_NONE, 70 TRANSACTION_READ_COMMITTED, 70 TRANSACTION_READ_UNCOMMITTED, 70 TRANSACTION_REPEATABLE_READ, 71 transactions, 23 aborting (see ROLLBACKs) boundaries, 166 deadlocks, 170 distributed, 99-101 exception handling, 167 permanent (see COMMITs) persistence and, 183-193 RMI, no built-in support for, 117 tracking changes to, 167-169, 185 visibility issues, 70 TRANSACTION_SERIALIZABLE, 71 tree components, Swing support for, 215 TreeModel class, 208 three-tier database application, 215 TreeNode implementations, 215 Trifox, Inc., 33 two-phase commits, 165 two-tier architecture, 129-133 fat-client systems, 131 limitations to, 131 object reuse, 132 using Java with, 130 when to use, 133 two-tier database applications, 210-215 type mapping system, JDBC 2.0, 77 TYPE_FORWARD_ONLY result set, 46 type-map object, 77 Types class, 50, 77, 291 TYPE_SCROLL_INSENSITIVE result set, 46, 69 TYPE_SCROLL_SENSITIVE result set, 46, 69 U[ Top ] UI delegates, Swing API, 208 monitoring models for changes, 219-221 UML diagrams, 127 component transactions, 186 composite pattern, 140 distributed listener pattern, 139 mid-tier business objects, 144 unencrypted passwords, 160 UnicastRemoteObject class, 111 providing custom socket factories, 164 Unicode, Java strings, 8 Unified Modeling Language (see UML diagrams) uniform resource locators (see URLs) unique identifiers, distributed components, 149-156, 170-172 unmarshaling, remote method calls, 112 updatable result sets (see result sets, updatable) UPDATE statement, 21 updateRow( ), 68 URLs, 29, 35 binding objects to, 109 RMI (Remote Method Invocation), 109 URL lookups, 111 using JDBC 2.0 Optional Package, 92 user interface, 207-223 accessibility issues, 9 banking application, 145 business objects and, 135 client patterns and, 138 V[ Top ] validation, component security, 161 VARBINARY datatype, 72 VARCHAR datatype, 44, 72 vendors, JDBC driver, 31-33 views (GUI widgets), 208 visibility of changes, updatable result sets, 69-71 Visigenic, 33 W[ Top ] warnings, JDBC, 51 wasNull( ), 41 WHERE clause, 21 Wittgenstein, Ludwig, xvi, 126, 183 worker threads, Swing API, 221-223 WorkerThread object, 221 X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
L[ Top ] last( ), 48 LDAP servers, 94 Liberty Integration Software, 32 listener pattern, 138 listeners, distributed (see distributed listener pattern) load( ), persistence delegate pattern and, 143 logical data models, 18 long-lived events executed by worker threads, 221-223 handling, 209 occurring in event queues, 219 lookup, objects EJB (Enterprise JavaBeans), 170-172 JNDI (Java Naming and Directory Interface), 107, 171 RMI (Remote Method Invocation), 117 Lotus Development, 32 M[ Top ] Management API, 7 marshaling, remote method calls, 112 Media API, 7 Media Frameworks API, 7 Memento class, 194 memento pattern, 143 separating business logic and persistence logic, 194 meta-data classes, JDBC, 79-91 SQL terminal monitor application, 82-91 mid-tier business objects, 134-136 model objects (GUI components), 208 event handling, 209-211 model-delegate pattern, 138, 208 models, database application, 210-219 model-view-controller (MVC) pattern, 138, 208 modification state, 185 moveToCurrentRow( ), 69 moveToInsertRow( ), 69 MsqlDataSource class, 94 mSQL-JDBC driver, 27 JDBC URL for, 30 multithreading, Swing API, 209 MVC (model-view-controller) pattern, 138, 208 N[ Top ] NAA (Network Application Architecture), 136 banking application, 143 Naming class, 111 naming services, 93, 106 DataSource interface, 297 Naming.rebind( ), 109 NetAway, 32 Network Application Architecture (NAA), 136 banking application, 143 network security, 162-164 next( ), 40, 47-49 Nietzsche, Friedrich, xvi, 92 node identifiers, ID generation, 149-152 nodes, root, 215-219 Nogginware Corporation, 33 nonremote objects, passing, 114-116 n-tier architecture (see three-tier architecture) null values, SQL NULL vs. Java null, 40 O[ Top ] object databases, 11 Object Design, 8 Object Management Group (OMG) IDL specification, 7 object serialization, 114-116 object servers, accessing remote objects, 109, 113 object-relational databases, 11 objects binding (JNDI), 106 exporting, 111 lookup EJB, 170-172 JNDI, 107, 171 RMI, 117 modification state of, 185 passing nonremote, 114-116 remote (see RMI) reuse of, 132 ODBC (Open DataBase Connectivity) vs. JDBC, 26, 34 ODBC-JDBC bridge, 26, 30 OMG (Object Management Group) IDL specification, 7 Open DataBase Connectivity (ODBC) vs. JDBC, 26, 34 Open Horizon, 8 OpenLink Software, 8, 33 optimistic concurrency mode, 197 Optional Package (see JDBC 2.0 features, Optional Package) Oracle Corporation, 8, 33 P[ Top ] parameters, binding, 58 passwords, unencrypted, 160 patterns, design, 137-143 business, 140-142 client, 138 composite, 140 data access, 142 distributed listener (see distributed listener pattern) factory, 141 custom client socket factory, 163 listener, 138 memento, 143, 194 model-delegate, 138, 208 model-view-controller (MVC), 138, 208 persistence delegate (see persistence delegate pattern) permanent transactions (see COMMITs) persistence, 183-206 banking application, 144 bean-managed, 124, 147 container-managed, drawbacks of, 124, 147 database transactions and, 183-193 impartiality needed for component model, 184 key behaviors of, 185 modification state, 185 of objects, 142, 185 RMI, no built-in support for, 117 search support, 197-206 separating business logic and persistence logic, 193 using design patterns, 194 persistence delegate pattern, 142 interface behaviors, 143 JDBC persistence, 196 search support, 197 separating business logic and persistence logic, 194 persistence library architecture of, 184 searching for objects using, 170 using JDBC classes, 195 Persistence Software, 8 PersistenceSupport interface, 194, 197 persistent components, 148-156 (see also entity beans) pessimistic concurrency mode, 197 phantom reads, 70 physical data models, 18 platform independence, Java, 6-8 polling threads, 221 PooledConnection interface, 298 pooling, connection, 95, 195, 296 portability date handling, 51 stored procedures and, 61 prepareCall( ), 61 prepared statements, 57-59 vs. stored procedures, 63 PreparedStatement class, 58, 255-258 batch processing, 64 Blob/Clob objects and, 73 when to use, 63 prepareStatement( ), 59 prepareUpdate( ), 168, 185 Presence Information Design, 8 previous( ), 47-49 primary keys, entity beans, 121, 148 printComments( ), 53 Pro-C Ltd., 8 process-oriented components, 148 (see also session beans) processResults( ), 87 methods used by, 88 properties file, for JDBC configuration, 37 PropertyChangeEvent, 173 distributed listeners and, 220 PropertyChangeListener, 220 PropertyChangeListener interface, 139 provider, EJB, 118 Q[ Top ] queries, 39-43 ResultSet class and, 40 subqueries, 22 (see also SELECT statement) query plans, building, 57-59 quotation marks, 19 R[ Top ] rebind( ), 109 Recital Corporation, 8, 33 reconnect( ), 173-181, 221 Ref class, 76, 259 REF type (SQL), 76 refreshRow( ), 71 registerOutParameter( ), 62 relational databases, 11, 15-19 object persistence and, 142 relative( ), 48 Remote interface, 110, 119 remote interfaces EJB (Enterprise JavaBeans), 119-122 RMI (Remote Method Invocation), 110 remote method calls marshaling/unmarshaling, 112 RemoteException, 113 skeletons/stubs, 112 Remote Method Invocation (see RMI) remote objects (see RMI) RemoteException, 113 remove( ), persistence delegate pattern and, 143 repeatable reads, 70 ResourceBundle class, 141 result set concurrency, 46, 67 result sets navigation of, 47-49 rowsets and, 96-99, 300-314 scrollable, 46-50 optimization of, 49 transaction isolation, 70 types, 46 updatable, 67-71 deleting values, 69 getting the latest data, 71 inserting new rows, 69 updating values, 68 using batch processing instead, 68 visibility of changes in, 69-71 ResultSet class, 259-273 queries and, 40 ResultSetMetaData class and, 79-81 rowsets and, 97 scrollable result sets, 46-50 ResultSetMetaData class, 79-81, 273-277 reuse of objects, 132 of source code, 132 RMI (Remote Method Invocation), 7 accessing remote objects, 13, 109, 113 application servers, 114 binding objects to URLs, 109 creating remote interfaces, 110 distributed computing support, 9 encrypting network communications, 162-164 exporting objects, 111 marshaling/unmarshaling, 112 object servers, 113 shortcomings of, 116 skeletons/stubs, 112 structure of, 108-113 vs. CORBA, 108 vs. EJB (Enterprise JavaBeans), 116 rmic (RMI compiler) command, 111 RogueWave Software, 8 rollback( ), 170 JDBC transactions, 193 ROLLBACKs, 23 mSQL and, 30 root nodes, 215-219 RootNode class (code example), 215-217 RowSet interface, 97-99, 300-306 constructing a model for database access, 211-215 RowSetEvent class, 306 RowSetInternal interface, 307 RowSetListener interface, 98, 308 RowSetMetaData interface, 309-312 RowSetReader interface, 313 rowsets, 96-99, 300-314 JavaBeans events, 98 RowSetWriter interface, 313 rules (see business rules) run( ), 209 S[ Top ] Sartre, Jean-Paul, xvi, 207 SAS Institute Inc., 8, 33 save( ), 220 SCO, 8, 33 scrollable result sets (see result sets, scrollable) SearchBinding class, 171 SearchCriteria class, 171, 205 searching for objects (see lookup, objects) using the persistence delegate, 197-206 secure socket layer (SSL) sockets, 162 Security API, 8 security issues components authentication, 156-161 identity tokens, 157, 160 unencrypted passwords, 160 validation, 161 databases, 164 distributed systems, 156-164, 167-169 networks, 162-164 RMI (Remote Method Invocation), 116 SELECT statement, 22, 39-43 (see also queries) sequence generators, ID generation, 149-156 SequenceGenerator class, code examples, 150-152, 153-156 Serializable interface, 115 serialization, object, 114-116 Server API, 8 server provider, EJB, 118 service providers, JNDI, 106 servlets, Java, 8 session beans, 119 (see also process-oriented components) SessionBean method, 121 setAutoCommit( ), 42 setBlob( ), 73 setClob( ), 73 setFetchDirection( ), 49 setFetchSize( ), 49 setString( ), 76 Simba Technologies, Inc., 33 single quotation marks ('), 19 skeletons and remote method calls, 112 Socket class, 162 sockets, 162-164 custom socket factories, 162 Software AG, 33 Solid Information Technology, 33 source code reuse, 132 special exception, remote methods, 113 SQL language, 10, 19-23 arrays, 75, 227-229 Java datatypes, mapping, 44-46, 77 NULL vs. Java null, 40 prepared statements, 57-59 SQL2, 23 datatype support, 44, 71 SQL3, 24 array objects, 227-229 datatype mappings, 45 datatype support, 76 structured types, 287 SQL/92, 23 stored procedures, 60-62 transaction logic, 23 VARCHAR datatype, 44 SQLData class, 277 SQLException class, 50 SQLInput class, 279 SQLJ paradigm, 34 SQLOutput class, 280-282 SQLWarning class, 51 SSL (secure socket layer) sockets, 162 StarQuest Software, 33 Statement class, 39, 282-287 batch processing, 64 execute( ) and, 80 PreparedStatement interface and, 58 when to use, 63 store( ), persistence delegate pattern and, 143, 196 stored procedures, 10, 60-62 vs. prepared statements, 63 Struct class, 76, 287 STRUCT type (SQL), 76 stubs and remote method calls, 112 subqueries, 22 Support class (full source code), 197-205 support classes, 50 Swing API, 138, 208-223 distributed listeners, 219-221 event queues, 209 handling long-lived events, 209 model-delegate architecture, 208 multithreading in, 209 MVC (model-view-controller), 208 three-tier database applications, 215-219 tree component support, 215 two-tier database application, 210-215 UI delegates, 208 monitoring models for changes, 219-221 worker threads, 221-223 SwingUtilities class, 209 Sybase, 8, 33 Symantec, 8, 33 system administrator, EJB, 118 T[ Top ] TableModel mode, 211 Telephony API, 8 ThinWeb SoftWare, 33 threads, Swing API, 209 three-tier architecture, 133-136 banking application, 143 centralized data processing, 134 data presentation, 135 drawbacks to, 136 Network Application Architecture, 136 three-tier database applications, 215-219 Thunderstone, 8 Time class, 51, 288 Timestamp class, 51, 289-291 tjFM, 33 /tmp/jdbc directory, 107 tokens, identity, 157, 160 Transaction class, 166-169 generic transaction logic (code example), 186-192 transaction isolation, 70 transaction management, 10 EJB (Enterprise JavaBeans), 165-170 TRANSACTION_NONE, 70 TRANSACTION_READ_COMMITTED, 70 TRANSACTION_READ_UNCOMMITTED, 70 TRANSACTION_REPEATABLE_READ, 71 transactions, 23 aborting (see ROLLBACKs) boundaries, 166 deadlocks, 170 distributed, 99-101 exception handling, 167 permanent (see COMMITs) persistence and, 183-193 RMI, no built-in support for, 117 tracking changes to, 167-169, 185 visibility issues, 70 TRANSACTION_SERIALIZABLE, 71 tree components, Swing support for, 215 TreeModel class, 208 three-tier database application, 215 TreeNode implementations, 215 Trifox, Inc., 33 two-phase commits, 165 two-tier architecture, 129-133 fat-client systems, 131 limitations to, 131 object reuse, 132 using Java with, 130 when to use, 133 two-tier database applications, 210-215 type mapping system, JDBC 2.0, 77 TYPE_FORWARD_ONLY result set, 46 type-map object, 77 Types class, 50, 77, 291 TYPE_SCROLL_INSENSITIVE result set, 46, 69 TYPE_SCROLL_SENSITIVE result set, 46, 69 U[ Top ] UI delegates, Swing API, 208 monitoring models for changes, 219-221 UML diagrams, 127 component transactions, 186 composite pattern, 140 distributed listener pattern, 139 mid-tier business objects, 144 unencrypted passwords, 160 UnicastRemoteObject class, 111 providing custom socket factories, 164 Unicode, Java strings, 8 Unified Modeling Language (see UML diagrams) uniform resource locators (see URLs) unique identifiers, distributed components, 149-156, 170-172 unmarshaling, remote method calls, 112 updatable result sets (see result sets, updatable) UPDATE statement, 21 updateRow( ), 68 URLs, 29, 35 binding objects to, 109 RMI (Remote Method Invocation), 109 URL lookups, 111 using JDBC 2.0 Optional Package, 92 user interface, 207-223 accessibility issues, 9 banking application, 145 business objects and, 135 client patterns and, 138 V[ Top ] validation, component security, 161 VARBINARY datatype, 72 VARCHAR datatype, 44, 72 vendors, JDBC driver, 31-33 views (GUI widgets), 208 visibility of changes, updatable result sets, 69-71 Visigenic, 33 W[ Top ] warnings, JDBC, 51 wasNull( ), 41 WHERE clause, 21 Wittgenstein, Ludwig, xvi, 126, 183 worker threads, Swing API, 221-223 WorkerThread object, 221 X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
M[ Top ] Management API, 7 marshaling, remote method calls, 112 Media API, 7 Media Frameworks API, 7 Memento class, 194 memento pattern, 143 separating business logic and persistence logic, 194 meta-data classes, JDBC, 79-91 SQL terminal monitor application, 82-91 mid-tier business objects, 134-136 model objects (GUI components), 208 event handling, 209-211 model-delegate pattern, 138, 208 models, database application, 210-219 model-view-controller (MVC) pattern, 138, 208 modification state, 185 moveToCurrentRow( ), 69 moveToInsertRow( ), 69 MsqlDataSource class, 94 mSQL-JDBC driver, 27 JDBC URL for, 30 multithreading, Swing API, 209 MVC (model-view-controller) pattern, 138, 208 N[ Top ] NAA (Network Application Architecture), 136 banking application, 143 Naming class, 111 naming services, 93, 106 DataSource interface, 297 Naming.rebind( ), 109 NetAway, 32 Network Application Architecture (NAA), 136 banking application, 143 network security, 162-164 next( ), 40, 47-49 Nietzsche, Friedrich, xvi, 92 node identifiers, ID generation, 149-152 nodes, root, 215-219 Nogginware Corporation, 33 nonremote objects, passing, 114-116 n-tier architecture (see three-tier architecture) null values, SQL NULL vs. Java null, 40 O[ Top ] object databases, 11 Object Design, 8 Object Management Group (OMG) IDL specification, 7 object serialization, 114-116 object servers, accessing remote objects, 109, 113 object-relational databases, 11 objects binding (JNDI), 106 exporting, 111 lookup EJB, 170-172 JNDI, 107, 171 RMI, 117 modification state of, 185 passing nonremote, 114-116 remote (see RMI) reuse of, 132 ODBC (Open DataBase Connectivity) vs. JDBC, 26, 34 ODBC-JDBC bridge, 26, 30 OMG (Object Management Group) IDL specification, 7 Open DataBase Connectivity (ODBC) vs. JDBC, 26, 34 Open Horizon, 8 OpenLink Software, 8, 33 optimistic concurrency mode, 197 Optional Package (see JDBC 2.0 features, Optional Package) Oracle Corporation, 8, 33 P[ Top ] parameters, binding, 58 passwords, unencrypted, 160 patterns, design, 137-143 business, 140-142 client, 138 composite, 140 data access, 142 distributed listener (see distributed listener pattern) factory, 141 custom client socket factory, 163 listener, 138 memento, 143, 194 model-delegate, 138, 208 model-view-controller (MVC), 138, 208 persistence delegate (see persistence delegate pattern) permanent transactions (see COMMITs) persistence, 183-206 banking application, 144 bean-managed, 124, 147 container-managed, drawbacks of, 124, 147 database transactions and, 183-193 impartiality needed for component model, 184 key behaviors of, 185 modification state, 185 of objects, 142, 185 RMI, no built-in support for, 117 search support, 197-206 separating business logic and persistence logic, 193 using design patterns, 194 persistence delegate pattern, 142 interface behaviors, 143 JDBC persistence, 196 search support, 197 separating business logic and persistence logic, 194 persistence library architecture of, 184 searching for objects using, 170 using JDBC classes, 195 Persistence Software, 8 PersistenceSupport interface, 194, 197 persistent components, 148-156 (see also entity beans) pessimistic concurrency mode, 197 phantom reads, 70 physical data models, 18 platform independence, Java, 6-8 polling threads, 221 PooledConnection interface, 298 pooling, connection, 95, 195, 296 portability date handling, 51 stored procedures and, 61 prepareCall( ), 61 prepared statements, 57-59 vs. stored procedures, 63 PreparedStatement class, 58, 255-258 batch processing, 64 Blob/Clob objects and, 73 when to use, 63 prepareStatement( ), 59 prepareUpdate( ), 168, 185 Presence Information Design, 8 previous( ), 47-49 primary keys, entity beans, 121, 148 printComments( ), 53 Pro-C Ltd., 8 process-oriented components, 148 (see also session beans) processResults( ), 87 methods used by, 88 properties file, for JDBC configuration, 37 PropertyChangeEvent, 173 distributed listeners and, 220 PropertyChangeListener, 220 PropertyChangeListener interface, 139 provider, EJB, 118 Q[ Top ] queries, 39-43 ResultSet class and, 40 subqueries, 22 (see also SELECT statement) query plans, building, 57-59 quotation marks, 19 R[ Top ] rebind( ), 109 Recital Corporation, 8, 33 reconnect( ), 173-181, 221 Ref class, 76, 259 REF type (SQL), 76 refreshRow( ), 71 registerOutParameter( ), 62 relational databases, 11, 15-19 object persistence and, 142 relative( ), 48 Remote interface, 110, 119 remote interfaces EJB (Enterprise JavaBeans), 119-122 RMI (Remote Method Invocation), 110 remote method calls marshaling/unmarshaling, 112 RemoteException, 113 skeletons/stubs, 112 Remote Method Invocation (see RMI) remote objects (see RMI) RemoteException, 113 remove( ), persistence delegate pattern and, 143 repeatable reads, 70 ResourceBundle class, 141 result set concurrency, 46, 67 result sets navigation of, 47-49 rowsets and, 96-99, 300-314 scrollable, 46-50 optimization of, 49 transaction isolation, 70 types, 46 updatable, 67-71 deleting values, 69 getting the latest data, 71 inserting new rows, 69 updating values, 68 using batch processing instead, 68 visibility of changes in, 69-71 ResultSet class, 259-273 queries and, 40 ResultSetMetaData class and, 79-81 rowsets and, 97 scrollable result sets, 46-50 ResultSetMetaData class, 79-81, 273-277 reuse of objects, 132 of source code, 132 RMI (Remote Method Invocation), 7 accessing remote objects, 13, 109, 113 application servers, 114 binding objects to URLs, 109 creating remote interfaces, 110 distributed computing support, 9 encrypting network communications, 162-164 exporting objects, 111 marshaling/unmarshaling, 112 object servers, 113 shortcomings of, 116 skeletons/stubs, 112 structure of, 108-113 vs. CORBA, 108 vs. EJB (Enterprise JavaBeans), 116 rmic (RMI compiler) command, 111 RogueWave Software, 8 rollback( ), 170 JDBC transactions, 193 ROLLBACKs, 23 mSQL and, 30 root nodes, 215-219 RootNode class (code example), 215-217 RowSet interface, 97-99, 300-306 constructing a model for database access, 211-215 RowSetEvent class, 306 RowSetInternal interface, 307 RowSetListener interface, 98, 308 RowSetMetaData interface, 309-312 RowSetReader interface, 313 rowsets, 96-99, 300-314 JavaBeans events, 98 RowSetWriter interface, 313 rules (see business rules) run( ), 209 S[ Top ] Sartre, Jean-Paul, xvi, 207 SAS Institute Inc., 8, 33 save( ), 220 SCO, 8, 33 scrollable result sets (see result sets, scrollable) SearchBinding class, 171 SearchCriteria class, 171, 205 searching for objects (see lookup, objects) using the persistence delegate, 197-206 secure socket layer (SSL) sockets, 162 Security API, 8 security issues components authentication, 156-161 identity tokens, 157, 160 unencrypted passwords, 160 validation, 161 databases, 164 distributed systems, 156-164, 167-169 networks, 162-164 RMI (Remote Method Invocation), 116 SELECT statement, 22, 39-43 (see also queries) sequence generators, ID generation, 149-156 SequenceGenerator class, code examples, 150-152, 153-156 Serializable interface, 115 serialization, object, 114-116 Server API, 8 server provider, EJB, 118 service providers, JNDI, 106 servlets, Java, 8 session beans, 119 (see also process-oriented components) SessionBean method, 121 setAutoCommit( ), 42 setBlob( ), 73 setClob( ), 73 setFetchDirection( ), 49 setFetchSize( ), 49 setString( ), 76 Simba Technologies, Inc., 33 single quotation marks ('), 19 skeletons and remote method calls, 112 Socket class, 162 sockets, 162-164 custom socket factories, 162 Software AG, 33 Solid Information Technology, 33 source code reuse, 132 special exception, remote methods, 113 SQL language, 10, 19-23 arrays, 75, 227-229 Java datatypes, mapping, 44-46, 77 NULL vs. Java null, 40 prepared statements, 57-59 SQL2, 23 datatype support, 44, 71 SQL3, 24 array objects, 227-229 datatype mappings, 45 datatype support, 76 structured types, 287 SQL/92, 23 stored procedures, 60-62 transaction logic, 23 VARCHAR datatype, 44 SQLData class, 277 SQLException class, 50 SQLInput class, 279 SQLJ paradigm, 34 SQLOutput class, 280-282 SQLWarning class, 51 SSL (secure socket layer) sockets, 162 StarQuest Software, 33 Statement class, 39, 282-287 batch processing, 64 execute( ) and, 80 PreparedStatement interface and, 58 when to use, 63 store( ), persistence delegate pattern and, 143, 196 stored procedures, 10, 60-62 vs. prepared statements, 63 Struct class, 76, 287 STRUCT type (SQL), 76 stubs and remote method calls, 112 subqueries, 22 Support class (full source code), 197-205 support classes, 50 Swing API, 138, 208-223 distributed listeners, 219-221 event queues, 209 handling long-lived events, 209 model-delegate architecture, 208 multithreading in, 209 MVC (model-view-controller), 208 three-tier database applications, 215-219 tree component support, 215 two-tier database application, 210-215 UI delegates, 208 monitoring models for changes, 219-221 worker threads, 221-223 SwingUtilities class, 209 Sybase, 8, 33 Symantec, 8, 33 system administrator, EJB, 118 T[ Top ] TableModel mode, 211 Telephony API, 8 ThinWeb SoftWare, 33 threads, Swing API, 209 three-tier architecture, 133-136 banking application, 143 centralized data processing, 134 data presentation, 135 drawbacks to, 136 Network Application Architecture, 136 three-tier database applications, 215-219 Thunderstone, 8 Time class, 51, 288 Timestamp class, 51, 289-291 tjFM, 33 /tmp/jdbc directory, 107 tokens, identity, 157, 160 Transaction class, 166-169 generic transaction logic (code example), 186-192 transaction isolation, 70 transaction management, 10 EJB (Enterprise JavaBeans), 165-170 TRANSACTION_NONE, 70 TRANSACTION_READ_COMMITTED, 70 TRANSACTION_READ_UNCOMMITTED, 70 TRANSACTION_REPEATABLE_READ, 71 transactions, 23 aborting (see ROLLBACKs) boundaries, 166 deadlocks, 170 distributed, 99-101 exception handling, 167 permanent (see COMMITs) persistence and, 183-193 RMI, no built-in support for, 117 tracking changes to, 167-169, 185 visibility issues, 70 TRANSACTION_SERIALIZABLE, 71 tree components, Swing support for, 215 TreeModel class, 208 three-tier database application, 215 TreeNode implementations, 215 Trifox, Inc., 33 two-phase commits, 165 two-tier architecture, 129-133 fat-client systems, 131 limitations to, 131 object reuse, 132 using Java with, 130 when to use, 133 two-tier database applications, 210-215 type mapping system, JDBC 2.0, 77 TYPE_FORWARD_ONLY result set, 46 type-map object, 77 Types class, 50, 77, 291 TYPE_SCROLL_INSENSITIVE result set, 46, 69 TYPE_SCROLL_SENSITIVE result set, 46, 69 U[ Top ] UI delegates, Swing API, 208 monitoring models for changes, 219-221 UML diagrams, 127 component transactions, 186 composite pattern, 140 distributed listener pattern, 139 mid-tier business objects, 144 unencrypted passwords, 160 UnicastRemoteObject class, 111 providing custom socket factories, 164 Unicode, Java strings, 8 Unified Modeling Language (see UML diagrams) uniform resource locators (see URLs) unique identifiers, distributed components, 149-156, 170-172 unmarshaling, remote method calls, 112 updatable result sets (see result sets, updatable) UPDATE statement, 21 updateRow( ), 68 URLs, 29, 35 binding objects to, 109 RMI (Remote Method Invocation), 109 URL lookups, 111 using JDBC 2.0 Optional Package, 92 user interface, 207-223 accessibility issues, 9 banking application, 145 business objects and, 135 client patterns and, 138 V[ Top ] validation, component security, 161 VARBINARY datatype, 72 VARCHAR datatype, 44, 72 vendors, JDBC driver, 31-33 views (GUI widgets), 208 visibility of changes, updatable result sets, 69-71 Visigenic, 33 W[ Top ] warnings, JDBC, 51 wasNull( ), 41 WHERE clause, 21 Wittgenstein, Ludwig, xvi, 126, 183 worker threads, Swing API, 221-223 WorkerThread object, 221 X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
N[ Top ] NAA (Network Application Architecture), 136 banking application, 143 Naming class, 111 naming services, 93, 106 DataSource interface, 297 Naming.rebind( ), 109 NetAway, 32 Network Application Architecture (NAA), 136 banking application, 143 network security, 162-164 next( ), 40, 47-49 Nietzsche, Friedrich, xvi, 92 node identifiers, ID generation, 149-152 nodes, root, 215-219 Nogginware Corporation, 33 nonremote objects, passing, 114-116 n-tier architecture (see three-tier architecture) null values, SQL NULL vs. Java null, 40 O[ Top ] object databases, 11 Object Design, 8 Object Management Group (OMG) IDL specification, 7 object serialization, 114-116 object servers, accessing remote objects, 109, 113 object-relational databases, 11 objects binding (JNDI), 106 exporting, 111 lookup EJB, 170-172 JNDI, 107, 171 RMI, 117 modification state of, 185 passing nonremote, 114-116 remote (see RMI) reuse of, 132 ODBC (Open DataBase Connectivity) vs. JDBC, 26, 34 ODBC-JDBC bridge, 26, 30 OMG (Object Management Group) IDL specification, 7 Open DataBase Connectivity (ODBC) vs. JDBC, 26, 34 Open Horizon, 8 OpenLink Software, 8, 33 optimistic concurrency mode, 197 Optional Package (see JDBC 2.0 features, Optional Package) Oracle Corporation, 8, 33 P[ Top ] parameters, binding, 58 passwords, unencrypted, 160 patterns, design, 137-143 business, 140-142 client, 138 composite, 140 data access, 142 distributed listener (see distributed listener pattern) factory, 141 custom client socket factory, 163 listener, 138 memento, 143, 194 model-delegate, 138, 208 model-view-controller (MVC), 138, 208 persistence delegate (see persistence delegate pattern) permanent transactions (see COMMITs) persistence, 183-206 banking application, 144 bean-managed, 124, 147 container-managed, drawbacks of, 124, 147 database transactions and, 183-193 impartiality needed for component model, 184 key behaviors of, 185 modification state, 185 of objects, 142, 185 RMI, no built-in support for, 117 search support, 197-206 separating business logic and persistence logic, 193 using design patterns, 194 persistence delegate pattern, 142 interface behaviors, 143 JDBC persistence, 196 search support, 197 separating business logic and persistence logic, 194 persistence library architecture of, 184 searching for objects using, 170 using JDBC classes, 195 Persistence Software, 8 PersistenceSupport interface, 194, 197 persistent components, 148-156 (see also entity beans) pessimistic concurrency mode, 197 phantom reads, 70 physical data models, 18 platform independence, Java, 6-8 polling threads, 221 PooledConnection interface, 298 pooling, connection, 95, 195, 296 portability date handling, 51 stored procedures and, 61 prepareCall( ), 61 prepared statements, 57-59 vs. stored procedures, 63 PreparedStatement class, 58, 255-258 batch processing, 64 Blob/Clob objects and, 73 when to use, 63 prepareStatement( ), 59 prepareUpdate( ), 168, 185 Presence Information Design, 8 previous( ), 47-49 primary keys, entity beans, 121, 148 printComments( ), 53 Pro-C Ltd., 8 process-oriented components, 148 (see also session beans) processResults( ), 87 methods used by, 88 properties file, for JDBC configuration, 37 PropertyChangeEvent, 173 distributed listeners and, 220 PropertyChangeListener, 220 PropertyChangeListener interface, 139 provider, EJB, 118 Q[ Top ] queries, 39-43 ResultSet class and, 40 subqueries, 22 (see also SELECT statement) query plans, building, 57-59 quotation marks, 19 R[ Top ] rebind( ), 109 Recital Corporation, 8, 33 reconnect( ), 173-181, 221 Ref class, 76, 259 REF type (SQL), 76 refreshRow( ), 71 registerOutParameter( ), 62 relational databases, 11, 15-19 object persistence and, 142 relative( ), 48 Remote interface, 110, 119 remote interfaces EJB (Enterprise JavaBeans), 119-122 RMI (Remote Method Invocation), 110 remote method calls marshaling/unmarshaling, 112 RemoteException, 113 skeletons/stubs, 112 Remote Method Invocation (see RMI) remote objects (see RMI) RemoteException, 113 remove( ), persistence delegate pattern and, 143 repeatable reads, 70 ResourceBundle class, 141 result set concurrency, 46, 67 result sets navigation of, 47-49 rowsets and, 96-99, 300-314 scrollable, 46-50 optimization of, 49 transaction isolation, 70 types, 46 updatable, 67-71 deleting values, 69 getting the latest data, 71 inserting new rows, 69 updating values, 68 using batch processing instead, 68 visibility of changes in, 69-71 ResultSet class, 259-273 queries and, 40 ResultSetMetaData class and, 79-81 rowsets and, 97 scrollable result sets, 46-50 ResultSetMetaData class, 79-81, 273-277 reuse of objects, 132 of source code, 132 RMI (Remote Method Invocation), 7 accessing remote objects, 13, 109, 113 application servers, 114 binding objects to URLs, 109 creating remote interfaces, 110 distributed computing support, 9 encrypting network communications, 162-164 exporting objects, 111 marshaling/unmarshaling, 112 object servers, 113 shortcomings of, 116 skeletons/stubs, 112 structure of, 108-113 vs. CORBA, 108 vs. EJB (Enterprise JavaBeans), 116 rmic (RMI compiler) command, 111 RogueWave Software, 8 rollback( ), 170 JDBC transactions, 193 ROLLBACKs, 23 mSQL and, 30 root nodes, 215-219 RootNode class (code example), 215-217 RowSet interface, 97-99, 300-306 constructing a model for database access, 211-215 RowSetEvent class, 306 RowSetInternal interface, 307 RowSetListener interface, 98, 308 RowSetMetaData interface, 309-312 RowSetReader interface, 313 rowsets, 96-99, 300-314 JavaBeans events, 98 RowSetWriter interface, 313 rules (see business rules) run( ), 209 S[ Top ] Sartre, Jean-Paul, xvi, 207 SAS Institute Inc., 8, 33 save( ), 220 SCO, 8, 33 scrollable result sets (see result sets, scrollable) SearchBinding class, 171 SearchCriteria class, 171, 205 searching for objects (see lookup, objects) using the persistence delegate, 197-206 secure socket layer (SSL) sockets, 162 Security API, 8 security issues components authentication, 156-161 identity tokens, 157, 160 unencrypted passwords, 160 validation, 161 databases, 164 distributed systems, 156-164, 167-169 networks, 162-164 RMI (Remote Method Invocation), 116 SELECT statement, 22, 39-43 (see also queries) sequence generators, ID generation, 149-156 SequenceGenerator class, code examples, 150-152, 153-156 Serializable interface, 115 serialization, object, 114-116 Server API, 8 server provider, EJB, 118 service providers, JNDI, 106 servlets, Java, 8 session beans, 119 (see also process-oriented components) SessionBean method, 121 setAutoCommit( ), 42 setBlob( ), 73 setClob( ), 73 setFetchDirection( ), 49 setFetchSize( ), 49 setString( ), 76 Simba Technologies, Inc., 33 single quotation marks ('), 19 skeletons and remote method calls, 112 Socket class, 162 sockets, 162-164 custom socket factories, 162 Software AG, 33 Solid Information Technology, 33 source code reuse, 132 special exception, remote methods, 113 SQL language, 10, 19-23 arrays, 75, 227-229 Java datatypes, mapping, 44-46, 77 NULL vs. Java null, 40 prepared statements, 57-59 SQL2, 23 datatype support, 44, 71 SQL3, 24 array objects, 227-229 datatype mappings, 45 datatype support, 76 structured types, 287 SQL/92, 23 stored procedures, 60-62 transaction logic, 23 VARCHAR datatype, 44 SQLData class, 277 SQLException class, 50 SQLInput class, 279 SQLJ paradigm, 34 SQLOutput class, 280-282 SQLWarning class, 51 SSL (secure socket layer) sockets, 162 StarQuest Software, 33 Statement class, 39, 282-287 batch processing, 64 execute( ) and, 80 PreparedStatement interface and, 58 when to use, 63 store( ), persistence delegate pattern and, 143, 196 stored procedures, 10, 60-62 vs. prepared statements, 63 Struct class, 76, 287 STRUCT type (SQL), 76 stubs and remote method calls, 112 subqueries, 22 Support class (full source code), 197-205 support classes, 50 Swing API, 138, 208-223 distributed listeners, 219-221 event queues, 209 handling long-lived events, 209 model-delegate architecture, 208 multithreading in, 209 MVC (model-view-controller), 208 three-tier database applications, 215-219 tree component support, 215 two-tier database application, 210-215 UI delegates, 208 monitoring models for changes, 219-221 worker threads, 221-223 SwingUtilities class, 209 Sybase, 8, 33 Symantec, 8, 33 system administrator, EJB, 118 T[ Top ] TableModel mode, 211 Telephony API, 8 ThinWeb SoftWare, 33 threads, Swing API, 209 three-tier architecture, 133-136 banking application, 143 centralized data processing, 134 data presentation, 135 drawbacks to, 136 Network Application Architecture, 136 three-tier database applications, 215-219 Thunderstone, 8 Time class, 51, 288 Timestamp class, 51, 289-291 tjFM, 33 /tmp/jdbc directory, 107 tokens, identity, 157, 160 Transaction class, 166-169 generic transaction logic (code example), 186-192 transaction isolation, 70 transaction management, 10 EJB (Enterprise JavaBeans), 165-170 TRANSACTION_NONE, 70 TRANSACTION_READ_COMMITTED, 70 TRANSACTION_READ_UNCOMMITTED, 70 TRANSACTION_REPEATABLE_READ, 71 transactions, 23 aborting (see ROLLBACKs) boundaries, 166 deadlocks, 170 distributed, 99-101 exception handling, 167 permanent (see COMMITs) persistence and, 183-193 RMI, no built-in support for, 117 tracking changes to, 167-169, 185 visibility issues, 70 TRANSACTION_SERIALIZABLE, 71 tree components, Swing support for, 215 TreeModel class, 208 three-tier database application, 215 TreeNode implementations, 215 Trifox, Inc., 33 two-phase commits, 165 two-tier architecture, 129-133 fat-client systems, 131 limitations to, 131 object reuse, 132 using Java with, 130 when to use, 133 two-tier database applications, 210-215 type mapping system, JDBC 2.0, 77 TYPE_FORWARD_ONLY result set, 46 type-map object, 77 Types class, 50, 77, 291 TYPE_SCROLL_INSENSITIVE result set, 46, 69 TYPE_SCROLL_SENSITIVE result set, 46, 69 U[ Top ] UI delegates, Swing API, 208 monitoring models for changes, 219-221 UML diagrams, 127 component transactions, 186 composite pattern, 140 distributed listener pattern, 139 mid-tier business objects, 144 unencrypted passwords, 160 UnicastRemoteObject class, 111 providing custom socket factories, 164 Unicode, Java strings, 8 Unified Modeling Language (see UML diagrams) uniform resource locators (see URLs) unique identifiers, distributed components, 149-156, 170-172 unmarshaling, remote method calls, 112 updatable result sets (see result sets, updatable) UPDATE statement, 21 updateRow( ), 68 URLs, 29, 35 binding objects to, 109 RMI (Remote Method Invocation), 109 URL lookups, 111 using JDBC 2.0 Optional Package, 92 user interface, 207-223 accessibility issues, 9 banking application, 145 business objects and, 135 client patterns and, 138 V[ Top ] validation, component security, 161 VARBINARY datatype, 72 VARCHAR datatype, 44, 72 vendors, JDBC driver, 31-33 views (GUI widgets), 208 visibility of changes, updatable result sets, 69-71 Visigenic, 33 W[ Top ] warnings, JDBC, 51 wasNull( ), 41 WHERE clause, 21 Wittgenstein, Ludwig, xvi, 126, 183 worker threads, Swing API, 221-223 WorkerThread object, 221 X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
O[ Top ] object databases, 11 Object Design, 8 Object Management Group (OMG) IDL specification, 7 object serialization, 114-116 object servers, accessing remote objects, 109, 113 object-relational databases, 11 objects binding (JNDI), 106 exporting, 111 lookup EJB, 170-172 JNDI, 107, 171 RMI, 117 modification state of, 185 passing nonremote, 114-116 remote (see RMI) reuse of, 132 ODBC (Open DataBase Connectivity) vs. JDBC, 26, 34 ODBC-JDBC bridge, 26, 30 OMG (Object Management Group) IDL specification, 7 Open DataBase Connectivity (ODBC) vs. JDBC, 26, 34 Open Horizon, 8 OpenLink Software, 8, 33 optimistic concurrency mode, 197 Optional Package (see JDBC 2.0 features, Optional Package) Oracle Corporation, 8, 33 P[ Top ] parameters, binding, 58 passwords, unencrypted, 160 patterns, design, 137-143 business, 140-142 client, 138 composite, 140 data access, 142 distributed listener (see distributed listener pattern) factory, 141 custom client socket factory, 163 listener, 138 memento, 143, 194 model-delegate, 138, 208 model-view-controller (MVC), 138, 208 persistence delegate (see persistence delegate pattern) permanent transactions (see COMMITs) persistence, 183-206 banking application, 144 bean-managed, 124, 147 container-managed, drawbacks of, 124, 147 database transactions and, 183-193 impartiality needed for component model, 184 key behaviors of, 185 modification state, 185 of objects, 142, 185 RMI, no built-in support for, 117 search support, 197-206 separating business logic and persistence logic, 193 using design patterns, 194 persistence delegate pattern, 142 interface behaviors, 143 JDBC persistence, 196 search support, 197 separating business logic and persistence logic, 194 persistence library architecture of, 184 searching for objects using, 170 using JDBC classes, 195 Persistence Software, 8 PersistenceSupport interface, 194, 197 persistent components, 148-156 (see also entity beans) pessimistic concurrency mode, 197 phantom reads, 70 physical data models, 18 platform independence, Java, 6-8 polling threads, 221 PooledConnection interface, 298 pooling, connection, 95, 195, 296 portability date handling, 51 stored procedures and, 61 prepareCall( ), 61 prepared statements, 57-59 vs. stored procedures, 63 PreparedStatement class, 58, 255-258 batch processing, 64 Blob/Clob objects and, 73 when to use, 63 prepareStatement( ), 59 prepareUpdate( ), 168, 185 Presence Information Design, 8 previous( ), 47-49 primary keys, entity beans, 121, 148 printComments( ), 53 Pro-C Ltd., 8 process-oriented components, 148 (see also session beans) processResults( ), 87 methods used by, 88 properties file, for JDBC configuration, 37 PropertyChangeEvent, 173 distributed listeners and, 220 PropertyChangeListener, 220 PropertyChangeListener interface, 139 provider, EJB, 118 Q[ Top ] queries, 39-43 ResultSet class and, 40 subqueries, 22 (see also SELECT statement) query plans, building, 57-59 quotation marks, 19 R[ Top ] rebind( ), 109 Recital Corporation, 8, 33 reconnect( ), 173-181, 221 Ref class, 76, 259 REF type (SQL), 76 refreshRow( ), 71 registerOutParameter( ), 62 relational databases, 11, 15-19 object persistence and, 142 relative( ), 48 Remote interface, 110, 119 remote interfaces EJB (Enterprise JavaBeans), 119-122 RMI (Remote Method Invocation), 110 remote method calls marshaling/unmarshaling, 112 RemoteException, 113 skeletons/stubs, 112 Remote Method Invocation (see RMI) remote objects (see RMI) RemoteException, 113 remove( ), persistence delegate pattern and, 143 repeatable reads, 70 ResourceBundle class, 141 result set concurrency, 46, 67 result sets navigation of, 47-49 rowsets and, 96-99, 300-314 scrollable, 46-50 optimization of, 49 transaction isolation, 70 types, 46 updatable, 67-71 deleting values, 69 getting the latest data, 71 inserting new rows, 69 updating values, 68 using batch processing instead, 68 visibility of changes in, 69-71 ResultSet class, 259-273 queries and, 40 ResultSetMetaData class and, 79-81 rowsets and, 97 scrollable result sets, 46-50 ResultSetMetaData class, 79-81, 273-277 reuse of objects, 132 of source code, 132 RMI (Remote Method Invocation), 7 accessing remote objects, 13, 109, 113 application servers, 114 binding objects to URLs, 109 creating remote interfaces, 110 distributed computing support, 9 encrypting network communications, 162-164 exporting objects, 111 marshaling/unmarshaling, 112 object servers, 113 shortcomings of, 116 skeletons/stubs, 112 structure of, 108-113 vs. CORBA, 108 vs. EJB (Enterprise JavaBeans), 116 rmic (RMI compiler) command, 111 RogueWave Software, 8 rollback( ), 170 JDBC transactions, 193 ROLLBACKs, 23 mSQL and, 30 root nodes, 215-219 RootNode class (code example), 215-217 RowSet interface, 97-99, 300-306 constructing a model for database access, 211-215 RowSetEvent class, 306 RowSetInternal interface, 307 RowSetListener interface, 98, 308 RowSetMetaData interface, 309-312 RowSetReader interface, 313 rowsets, 96-99, 300-314 JavaBeans events, 98 RowSetWriter interface, 313 rules (see business rules) run( ), 209 S[ Top ] Sartre, Jean-Paul, xvi, 207 SAS Institute Inc., 8, 33 save( ), 220 SCO, 8, 33 scrollable result sets (see result sets, scrollable) SearchBinding class, 171 SearchCriteria class, 171, 205 searching for objects (see lookup, objects) using the persistence delegate, 197-206 secure socket layer (SSL) sockets, 162 Security API, 8 security issues components authentication, 156-161 identity tokens, 157, 160 unencrypted passwords, 160 validation, 161 databases, 164 distributed systems, 156-164, 167-169 networks, 162-164 RMI (Remote Method Invocation), 116 SELECT statement, 22, 39-43 (see also queries) sequence generators, ID generation, 149-156 SequenceGenerator class, code examples, 150-152, 153-156 Serializable interface, 115 serialization, object, 114-116 Server API, 8 server provider, EJB, 118 service providers, JNDI, 106 servlets, Java, 8 session beans, 119 (see also process-oriented components) SessionBean method, 121 setAutoCommit( ), 42 setBlob( ), 73 setClob( ), 73 setFetchDirection( ), 49 setFetchSize( ), 49 setString( ), 76 Simba Technologies, Inc., 33 single quotation marks ('), 19 skeletons and remote method calls, 112 Socket class, 162 sockets, 162-164 custom socket factories, 162 Software AG, 33 Solid Information Technology, 33 source code reuse, 132 special exception, remote methods, 113 SQL language, 10, 19-23 arrays, 75, 227-229 Java datatypes, mapping, 44-46, 77 NULL vs. Java null, 40 prepared statements, 57-59 SQL2, 23 datatype support, 44, 71 SQL3, 24 array objects, 227-229 datatype mappings, 45 datatype support, 76 structured types, 287 SQL/92, 23 stored procedures, 60-62 transaction logic, 23 VARCHAR datatype, 44 SQLData class, 277 SQLException class, 50 SQLInput class, 279 SQLJ paradigm, 34 SQLOutput class, 280-282 SQLWarning class, 51 SSL (secure socket layer) sockets, 162 StarQuest Software, 33 Statement class, 39, 282-287 batch processing, 64 execute( ) and, 80 PreparedStatement interface and, 58 when to use, 63 store( ), persistence delegate pattern and, 143, 196 stored procedures, 10, 60-62 vs. prepared statements, 63 Struct class, 76, 287 STRUCT type (SQL), 76 stubs and remote method calls, 112 subqueries, 22 Support class (full source code), 197-205 support classes, 50 Swing API, 138, 208-223 distributed listeners, 219-221 event queues, 209 handling long-lived events, 209 model-delegate architecture, 208 multithreading in, 209 MVC (model-view-controller), 208 three-tier database applications, 215-219 tree component support, 215 two-tier database application, 210-215 UI delegates, 208 monitoring models for changes, 219-221 worker threads, 221-223 SwingUtilities class, 209 Sybase, 8, 33 Symantec, 8, 33 system administrator, EJB, 118 T[ Top ] TableModel mode, 211 Telephony API, 8 ThinWeb SoftWare, 33 threads, Swing API, 209 three-tier architecture, 133-136 banking application, 143 centralized data processing, 134 data presentation, 135 drawbacks to, 136 Network Application Architecture, 136 three-tier database applications, 215-219 Thunderstone, 8 Time class, 51, 288 Timestamp class, 51, 289-291 tjFM, 33 /tmp/jdbc directory, 107 tokens, identity, 157, 160 Transaction class, 166-169 generic transaction logic (code example), 186-192 transaction isolation, 70 transaction management, 10 EJB (Enterprise JavaBeans), 165-170 TRANSACTION_NONE, 70 TRANSACTION_READ_COMMITTED, 70 TRANSACTION_READ_UNCOMMITTED, 70 TRANSACTION_REPEATABLE_READ, 71 transactions, 23 aborting (see ROLLBACKs) boundaries, 166 deadlocks, 170 distributed, 99-101 exception handling, 167 permanent (see COMMITs) persistence and, 183-193 RMI, no built-in support for, 117 tracking changes to, 167-169, 185 visibility issues, 70 TRANSACTION_SERIALIZABLE, 71 tree components, Swing support for, 215 TreeModel class, 208 three-tier database application, 215 TreeNode implementations, 215 Trifox, Inc., 33 two-phase commits, 165 two-tier architecture, 129-133 fat-client systems, 131 limitations to, 131 object reuse, 132 using Java with, 130 when to use, 133 two-tier database applications, 210-215 type mapping system, JDBC 2.0, 77 TYPE_FORWARD_ONLY result set, 46 type-map object, 77 Types class, 50, 77, 291 TYPE_SCROLL_INSENSITIVE result set, 46, 69 TYPE_SCROLL_SENSITIVE result set, 46, 69 U[ Top ] UI delegates, Swing API, 208 monitoring models for changes, 219-221 UML diagrams, 127 component transactions, 186 composite pattern, 140 distributed listener pattern, 139 mid-tier business objects, 144 unencrypted passwords, 160 UnicastRemoteObject class, 111 providing custom socket factories, 164 Unicode, Java strings, 8 Unified Modeling Language (see UML diagrams) uniform resource locators (see URLs) unique identifiers, distributed components, 149-156, 170-172 unmarshaling, remote method calls, 112 updatable result sets (see result sets, updatable) UPDATE statement, 21 updateRow( ), 68 URLs, 29, 35 binding objects to, 109 RMI (Remote Method Invocation), 109 URL lookups, 111 using JDBC 2.0 Optional Package, 92 user interface, 207-223 accessibility issues, 9 banking application, 145 business objects and, 135 client patterns and, 138 V[ Top ] validation, component security, 161 VARBINARY datatype, 72 VARCHAR datatype, 44, 72 vendors, JDBC driver, 31-33 views (GUI widgets), 208 visibility of changes, updatable result sets, 69-71 Visigenic, 33 W[ Top ] warnings, JDBC, 51 wasNull( ), 41 WHERE clause, 21 Wittgenstein, Ludwig, xvi, 126, 183 worker threads, Swing API, 221-223 WorkerThread object, 221 X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
P[ Top ] parameters, binding, 58 passwords, unencrypted, 160 patterns, design, 137-143 business, 140-142 client, 138 composite, 140 data access, 142 distributed listener (see distributed listener pattern) factory, 141 custom client socket factory, 163 listener, 138 memento, 143, 194 model-delegate, 138, 208 model-view-controller (MVC), 138, 208 persistence delegate (see persistence delegate pattern) permanent transactions (see COMMITs) persistence, 183-206 banking application, 144 bean-managed, 124, 147 container-managed, drawbacks of, 124, 147 database transactions and, 183-193 impartiality needed for component model, 184 key behaviors of, 185 modification state, 185 of objects, 142, 185 RMI, no built-in support for, 117 search support, 197-206 separating business logic and persistence logic, 193 using design patterns, 194 persistence delegate pattern, 142 interface behaviors, 143 JDBC persistence, 196 search support, 197 separating business logic and persistence logic, 194 persistence library architecture of, 184 searching for objects using, 170 using JDBC classes, 195 Persistence Software, 8 PersistenceSupport interface, 194, 197 persistent components, 148-156 (see also entity beans) pessimistic concurrency mode, 197 phantom reads, 70 physical data models, 18 platform independence, Java, 6-8 polling threads, 221 PooledConnection interface, 298 pooling, connection, 95, 195, 296 portability date handling, 51 stored procedures and, 61 prepareCall( ), 61 prepared statements, 57-59 vs. stored procedures, 63 PreparedStatement class, 58, 255-258 batch processing, 64 Blob/Clob objects and, 73 when to use, 63 prepareStatement( ), 59 prepareUpdate( ), 168, 185 Presence Information Design, 8 previous( ), 47-49 primary keys, entity beans, 121, 148 printComments( ), 53 Pro-C Ltd., 8 process-oriented components, 148 (see also session beans) processResults( ), 87 methods used by, 88 properties file, for JDBC configuration, 37 PropertyChangeEvent, 173 distributed listeners and, 220 PropertyChangeListener, 220 PropertyChangeListener interface, 139 provider, EJB, 118 Q[ Top ] queries, 39-43 ResultSet class and, 40 subqueries, 22 (see also SELECT statement) query plans, building, 57-59 quotation marks, 19 R[ Top ] rebind( ), 109 Recital Corporation, 8, 33 reconnect( ), 173-181, 221 Ref class, 76, 259 REF type (SQL), 76 refreshRow( ), 71 registerOutParameter( ), 62 relational databases, 11, 15-19 object persistence and, 142 relative( ), 48 Remote interface, 110, 119 remote interfaces EJB (Enterprise JavaBeans), 119-122 RMI (Remote Method Invocation), 110 remote method calls marshaling/unmarshaling, 112 RemoteException, 113 skeletons/stubs, 112 Remote Method Invocation (see RMI) remote objects (see RMI) RemoteException, 113 remove( ), persistence delegate pattern and, 143 repeatable reads, 70 ResourceBundle class, 141 result set concurrency, 46, 67 result sets navigation of, 47-49 rowsets and, 96-99, 300-314 scrollable, 46-50 optimization of, 49 transaction isolation, 70 types, 46 updatable, 67-71 deleting values, 69 getting the latest data, 71 inserting new rows, 69 updating values, 68 using batch processing instead, 68 visibility of changes in, 69-71 ResultSet class, 259-273 queries and, 40 ResultSetMetaData class and, 79-81 rowsets and, 97 scrollable result sets, 46-50 ResultSetMetaData class, 79-81, 273-277 reuse of objects, 132 of source code, 132 RMI (Remote Method Invocation), 7 accessing remote objects, 13, 109, 113 application servers, 114 binding objects to URLs, 109 creating remote interfaces, 110 distributed computing support, 9 encrypting network communications, 162-164 exporting objects, 111 marshaling/unmarshaling, 112 object servers, 113 shortcomings of, 116 skeletons/stubs, 112 structure of, 108-113 vs. CORBA, 108 vs. EJB (Enterprise JavaBeans), 116 rmic (RMI compiler) command, 111 RogueWave Software, 8 rollback( ), 170 JDBC transactions, 193 ROLLBACKs, 23 mSQL and, 30 root nodes, 215-219 RootNode class (code example), 215-217 RowSet interface, 97-99, 300-306 constructing a model for database access, 211-215 RowSetEvent class, 306 RowSetInternal interface, 307 RowSetListener interface, 98, 308 RowSetMetaData interface, 309-312 RowSetReader interface, 313 rowsets, 96-99, 300-314 JavaBeans events, 98 RowSetWriter interface, 313 rules (see business rules) run( ), 209 S[ Top ] Sartre, Jean-Paul, xvi, 207 SAS Institute Inc., 8, 33 save( ), 220 SCO, 8, 33 scrollable result sets (see result sets, scrollable) SearchBinding class, 171 SearchCriteria class, 171, 205 searching for objects (see lookup, objects) using the persistence delegate, 197-206 secure socket layer (SSL) sockets, 162 Security API, 8 security issues components authentication, 156-161 identity tokens, 157, 160 unencrypted passwords, 160 validation, 161 databases, 164 distributed systems, 156-164, 167-169 networks, 162-164 RMI (Remote Method Invocation), 116 SELECT statement, 22, 39-43 (see also queries) sequence generators, ID generation, 149-156 SequenceGenerator class, code examples, 150-152, 153-156 Serializable interface, 115 serialization, object, 114-116 Server API, 8 server provider, EJB, 118 service providers, JNDI, 106 servlets, Java, 8 session beans, 119 (see also process-oriented components) SessionBean method, 121 setAutoCommit( ), 42 setBlob( ), 73 setClob( ), 73 setFetchDirection( ), 49 setFetchSize( ), 49 setString( ), 76 Simba Technologies, Inc., 33 single quotation marks ('), 19 skeletons and remote method calls, 112 Socket class, 162 sockets, 162-164 custom socket factories, 162 Software AG, 33 Solid Information Technology, 33 source code reuse, 132 special exception, remote methods, 113 SQL language, 10, 19-23 arrays, 75, 227-229 Java datatypes, mapping, 44-46, 77 NULL vs. Java null, 40 prepared statements, 57-59 SQL2, 23 datatype support, 44, 71 SQL3, 24 array objects, 227-229 datatype mappings, 45 datatype support, 76 structured types, 287 SQL/92, 23 stored procedures, 60-62 transaction logic, 23 VARCHAR datatype, 44 SQLData class, 277 SQLException class, 50 SQLInput class, 279 SQLJ paradigm, 34 SQLOutput class, 280-282 SQLWarning class, 51 SSL (secure socket layer) sockets, 162 StarQuest Software, 33 Statement class, 39, 282-287 batch processing, 64 execute( ) and, 80 PreparedStatement interface and, 58 when to use, 63 store( ), persistence delegate pattern and, 143, 196 stored procedures, 10, 60-62 vs. prepared statements, 63 Struct class, 76, 287 STRUCT type (SQL), 76 stubs and remote method calls, 112 subqueries, 22 Support class (full source code), 197-205 support classes, 50 Swing API, 138, 208-223 distributed listeners, 219-221 event queues, 209 handling long-lived events, 209 model-delegate architecture, 208 multithreading in, 209 MVC (model-view-controller), 208 three-tier database applications, 215-219 tree component support, 215 two-tier database application, 210-215 UI delegates, 208 monitoring models for changes, 219-221 worker threads, 221-223 SwingUtilities class, 209 Sybase, 8, 33 Symantec, 8, 33 system administrator, EJB, 118 T[ Top ] TableModel mode, 211 Telephony API, 8 ThinWeb SoftWare, 33 threads, Swing API, 209 three-tier architecture, 133-136 banking application, 143 centralized data processing, 134 data presentation, 135 drawbacks to, 136 Network Application Architecture, 136 three-tier database applications, 215-219 Thunderstone, 8 Time class, 51, 288 Timestamp class, 51, 289-291 tjFM, 33 /tmp/jdbc directory, 107 tokens, identity, 157, 160 Transaction class, 166-169 generic transaction logic (code example), 186-192 transaction isolation, 70 transaction management, 10 EJB (Enterprise JavaBeans), 165-170 TRANSACTION_NONE, 70 TRANSACTION_READ_COMMITTED, 70 TRANSACTION_READ_UNCOMMITTED, 70 TRANSACTION_REPEATABLE_READ, 71 transactions, 23 aborting (see ROLLBACKs) boundaries, 166 deadlocks, 170 distributed, 99-101 exception handling, 167 permanent (see COMMITs) persistence and, 183-193 RMI, no built-in support for, 117 tracking changes to, 167-169, 185 visibility issues, 70 TRANSACTION_SERIALIZABLE, 71 tree components, Swing support for, 215 TreeModel class, 208 three-tier database application, 215 TreeNode implementations, 215 Trifox, Inc., 33 two-phase commits, 165 two-tier architecture, 129-133 fat-client systems, 131 limitations to, 131 object reuse, 132 using Java with, 130 when to use, 133 two-tier database applications, 210-215 type mapping system, JDBC 2.0, 77 TYPE_FORWARD_ONLY result set, 46 type-map object, 77 Types class, 50, 77, 291 TYPE_SCROLL_INSENSITIVE result set, 46, 69 TYPE_SCROLL_SENSITIVE result set, 46, 69 U[ Top ] UI delegates, Swing API, 208 monitoring models for changes, 219-221 UML diagrams, 127 component transactions, 186 composite pattern, 140 distributed listener pattern, 139 mid-tier business objects, 144 unencrypted passwords, 160 UnicastRemoteObject class, 111 providing custom socket factories, 164 Unicode, Java strings, 8 Unified Modeling Language (see UML diagrams) uniform resource locators (see URLs) unique identifiers, distributed components, 149-156, 170-172 unmarshaling, remote method calls, 112 updatable result sets (see result sets, updatable) UPDATE statement, 21 updateRow( ), 68 URLs, 29, 35 binding objects to, 109 RMI (Remote Method Invocation), 109 URL lookups, 111 using JDBC 2.0 Optional Package, 92 user interface, 207-223 accessibility issues, 9 banking application, 145 business objects and, 135 client patterns and, 138 V[ Top ] validation, component security, 161 VARBINARY datatype, 72 VARCHAR datatype, 44, 72 vendors, JDBC driver, 31-33 views (GUI widgets), 208 visibility of changes, updatable result sets, 69-71 Visigenic, 33 W[ Top ] warnings, JDBC, 51 wasNull( ), 41 WHERE clause, 21 Wittgenstein, Ludwig, xvi, 126, 183 worker threads, Swing API, 221-223 WorkerThread object, 221 X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
Q[ Top ] queries, 39-43 ResultSet class and, 40 subqueries, 22 (see also SELECT statement) query plans, building, 57-59 quotation marks, 19 R[ Top ] rebind( ), 109 Recital Corporation, 8, 33 reconnect( ), 173-181, 221 Ref class, 76, 259 REF type (SQL), 76 refreshRow( ), 71 registerOutParameter( ), 62 relational databases, 11, 15-19 object persistence and, 142 relative( ), 48 Remote interface, 110, 119 remote interfaces EJB (Enterprise JavaBeans), 119-122 RMI (Remote Method Invocation), 110 remote method calls marshaling/unmarshaling, 112 RemoteException, 113 skeletons/stubs, 112 Remote Method Invocation (see RMI) remote objects (see RMI) RemoteException, 113 remove( ), persistence delegate pattern and, 143 repeatable reads, 70 ResourceBundle class, 141 result set concurrency, 46, 67 result sets navigation of, 47-49 rowsets and, 96-99, 300-314 scrollable, 46-50 optimization of, 49 transaction isolation, 70 types, 46 updatable, 67-71 deleting values, 69 getting the latest data, 71 inserting new rows, 69 updating values, 68 using batch processing instead, 68 visibility of changes in, 69-71 ResultSet class, 259-273 queries and, 40 ResultSetMetaData class and, 79-81 rowsets and, 97 scrollable result sets, 46-50 ResultSetMetaData class, 79-81, 273-277 reuse of objects, 132 of source code, 132 RMI (Remote Method Invocation), 7 accessing remote objects, 13, 109, 113 application servers, 114 binding objects to URLs, 109 creating remote interfaces, 110 distributed computing support, 9 encrypting network communications, 162-164 exporting objects, 111 marshaling/unmarshaling, 112 object servers, 113 shortcomings of, 116 skeletons/stubs, 112 structure of, 108-113 vs. CORBA, 108 vs. EJB (Enterprise JavaBeans), 116 rmic (RMI compiler) command, 111 RogueWave Software, 8 rollback( ), 170 JDBC transactions, 193 ROLLBACKs, 23 mSQL and, 30 root nodes, 215-219 RootNode class (code example), 215-217 RowSet interface, 97-99, 300-306 constructing a model for database access, 211-215 RowSetEvent class, 306 RowSetInternal interface, 307 RowSetListener interface, 98, 308 RowSetMetaData interface, 309-312 RowSetReader interface, 313 rowsets, 96-99, 300-314 JavaBeans events, 98 RowSetWriter interface, 313 rules (see business rules) run( ), 209 S[ Top ] Sartre, Jean-Paul, xvi, 207 SAS Institute Inc., 8, 33 save( ), 220 SCO, 8, 33 scrollable result sets (see result sets, scrollable) SearchBinding class, 171 SearchCriteria class, 171, 205 searching for objects (see lookup, objects) using the persistence delegate, 197-206 secure socket layer (SSL) sockets, 162 Security API, 8 security issues components authentication, 156-161 identity tokens, 157, 160 unencrypted passwords, 160 validation, 161 databases, 164 distributed systems, 156-164, 167-169 networks, 162-164 RMI (Remote Method Invocation), 116 SELECT statement, 22, 39-43 (see also queries) sequence generators, ID generation, 149-156 SequenceGenerator class, code examples, 150-152, 153-156 Serializable interface, 115 serialization, object, 114-116 Server API, 8 server provider, EJB, 118 service providers, JNDI, 106 servlets, Java, 8 session beans, 119 (see also process-oriented components) SessionBean method, 121 setAutoCommit( ), 42 setBlob( ), 73 setClob( ), 73 setFetchDirection( ), 49 setFetchSize( ), 49 setString( ), 76 Simba Technologies, Inc., 33 single quotation marks ('), 19 skeletons and remote method calls, 112 Socket class, 162 sockets, 162-164 custom socket factories, 162 Software AG, 33 Solid Information Technology, 33 source code reuse, 132 special exception, remote methods, 113 SQL language, 10, 19-23 arrays, 75, 227-229 Java datatypes, mapping, 44-46, 77 NULL vs. Java null, 40 prepared statements, 57-59 SQL2, 23 datatype support, 44, 71 SQL3, 24 array objects, 227-229 datatype mappings, 45 datatype support, 76 structured types, 287 SQL/92, 23 stored procedures, 60-62 transaction logic, 23 VARCHAR datatype, 44 SQLData class, 277 SQLException class, 50 SQLInput class, 279 SQLJ paradigm, 34 SQLOutput class, 280-282 SQLWarning class, 51 SSL (secure socket layer) sockets, 162 StarQuest Software, 33 Statement class, 39, 282-287 batch processing, 64 execute( ) and, 80 PreparedStatement interface and, 58 when to use, 63 store( ), persistence delegate pattern and, 143, 196 stored procedures, 10, 60-62 vs. prepared statements, 63 Struct class, 76, 287 STRUCT type (SQL), 76 stubs and remote method calls, 112 subqueries, 22 Support class (full source code), 197-205 support classes, 50 Swing API, 138, 208-223 distributed listeners, 219-221 event queues, 209 handling long-lived events, 209 model-delegate architecture, 208 multithreading in, 209 MVC (model-view-controller), 208 three-tier database applications, 215-219 tree component support, 215 two-tier database application, 210-215 UI delegates, 208 monitoring models for changes, 219-221 worker threads, 221-223 SwingUtilities class, 209 Sybase, 8, 33 Symantec, 8, 33 system administrator, EJB, 118 T[ Top ] TableModel mode, 211 Telephony API, 8 ThinWeb SoftWare, 33 threads, Swing API, 209 three-tier architecture, 133-136 banking application, 143 centralized data processing, 134 data presentation, 135 drawbacks to, 136 Network Application Architecture, 136 three-tier database applications, 215-219 Thunderstone, 8 Time class, 51, 288 Timestamp class, 51, 289-291 tjFM, 33 /tmp/jdbc directory, 107 tokens, identity, 157, 160 Transaction class, 166-169 generic transaction logic (code example), 186-192 transaction isolation, 70 transaction management, 10 EJB (Enterprise JavaBeans), 165-170 TRANSACTION_NONE, 70 TRANSACTION_READ_COMMITTED, 70 TRANSACTION_READ_UNCOMMITTED, 70 TRANSACTION_REPEATABLE_READ, 71 transactions, 23 aborting (see ROLLBACKs) boundaries, 166 deadlocks, 170 distributed, 99-101 exception handling, 167 permanent (see COMMITs) persistence and, 183-193 RMI, no built-in support for, 117 tracking changes to, 167-169, 185 visibility issues, 70 TRANSACTION_SERIALIZABLE, 71 tree components, Swing support for, 215 TreeModel class, 208 three-tier database application, 215 TreeNode implementations, 215 Trifox, Inc., 33 two-phase commits, 165 two-tier architecture, 129-133 fat-client systems, 131 limitations to, 131 object reuse, 132 using Java with, 130 when to use, 133 two-tier database applications, 210-215 type mapping system, JDBC 2.0, 77 TYPE_FORWARD_ONLY result set, 46 type-map object, 77 Types class, 50, 77, 291 TYPE_SCROLL_INSENSITIVE result set, 46, 69 TYPE_SCROLL_SENSITIVE result set, 46, 69 U[ Top ] UI delegates, Swing API, 208 monitoring models for changes, 219-221 UML diagrams, 127 component transactions, 186 composite pattern, 140 distributed listener pattern, 139 mid-tier business objects, 144 unencrypted passwords, 160 UnicastRemoteObject class, 111 providing custom socket factories, 164 Unicode, Java strings, 8 Unified Modeling Language (see UML diagrams) uniform resource locators (see URLs) unique identifiers, distributed components, 149-156, 170-172 unmarshaling, remote method calls, 112 updatable result sets (see result sets, updatable) UPDATE statement, 21 updateRow( ), 68 URLs, 29, 35 binding objects to, 109 RMI (Remote Method Invocation), 109 URL lookups, 111 using JDBC 2.0 Optional Package, 92 user interface, 207-223 accessibility issues, 9 banking application, 145 business objects and, 135 client patterns and, 138 V[ Top ] validation, component security, 161 VARBINARY datatype, 72 VARCHAR datatype, 44, 72 vendors, JDBC driver, 31-33 views (GUI widgets), 208 visibility of changes, updatable result sets, 69-71 Visigenic, 33 W[ Top ] warnings, JDBC, 51 wasNull( ), 41 WHERE clause, 21 Wittgenstein, Ludwig, xvi, 126, 183 worker threads, Swing API, 221-223 WorkerThread object, 221 X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
R[ Top ] rebind( ), 109 Recital Corporation, 8, 33 reconnect( ), 173-181, 221 Ref class, 76, 259 REF type (SQL), 76 refreshRow( ), 71 registerOutParameter( ), 62 relational databases, 11, 15-19 object persistence and, 142 relative( ), 48 Remote interface, 110, 119 remote interfaces EJB (Enterprise JavaBeans), 119-122 RMI (Remote Method Invocation), 110 remote method calls marshaling/unmarshaling, 112 RemoteException, 113 skeletons/stubs, 112 Remote Method Invocation (see RMI) remote objects (see RMI) RemoteException, 113 remove( ), persistence delegate pattern and, 143 repeatable reads, 70 ResourceBundle class, 141 result set concurrency, 46, 67 result sets navigation of, 47-49 rowsets and, 96-99, 300-314 scrollable, 46-50 optimization of, 49 transaction isolation, 70 types, 46 updatable, 67-71 deleting values, 69 getting the latest data, 71 inserting new rows, 69 updating values, 68 using batch processing instead, 68 visibility of changes in, 69-71 ResultSet class, 259-273 queries and, 40 ResultSetMetaData class and, 79-81 rowsets and, 97 scrollable result sets, 46-50 ResultSetMetaData class, 79-81, 273-277 reuse of objects, 132 of source code, 132 RMI (Remote Method Invocation), 7 accessing remote objects, 13, 109, 113 application servers, 114 binding objects to URLs, 109 creating remote interfaces, 110 distributed computing support, 9 encrypting network communications, 162-164 exporting objects, 111 marshaling/unmarshaling, 112 object servers, 113 shortcomings of, 116 skeletons/stubs, 112 structure of, 108-113 vs. CORBA, 108 vs. EJB (Enterprise JavaBeans), 116 rmic (RMI compiler) command, 111 RogueWave Software, 8 rollback( ), 170 JDBC transactions, 193 ROLLBACKs, 23 mSQL and, 30 root nodes, 215-219 RootNode class (code example), 215-217 RowSet interface, 97-99, 300-306 constructing a model for database access, 211-215 RowSetEvent class, 306 RowSetInternal interface, 307 RowSetListener interface, 98, 308 RowSetMetaData interface, 309-312 RowSetReader interface, 313 rowsets, 96-99, 300-314 JavaBeans events, 98 RowSetWriter interface, 313 rules (see business rules) run( ), 209 S[ Top ] Sartre, Jean-Paul, xvi, 207 SAS Institute Inc., 8, 33 save( ), 220 SCO, 8, 33 scrollable result sets (see result sets, scrollable) SearchBinding class, 171 SearchCriteria class, 171, 205 searching for objects (see lookup, objects) using the persistence delegate, 197-206 secure socket layer (SSL) sockets, 162 Security API, 8 security issues components authentication, 156-161 identity tokens, 157, 160 unencrypted passwords, 160 validation, 161 databases, 164 distributed systems, 156-164, 167-169 networks, 162-164 RMI (Remote Method Invocation), 116 SELECT statement, 22, 39-43 (see also queries) sequence generators, ID generation, 149-156 SequenceGenerator class, code examples, 150-152, 153-156 Serializable interface, 115 serialization, object, 114-116 Server API, 8 server provider, EJB, 118 service providers, JNDI, 106 servlets, Java, 8 session beans, 119 (see also process-oriented components) SessionBean method, 121 setAutoCommit( ), 42 setBlob( ), 73 setClob( ), 73 setFetchDirection( ), 49 setFetchSize( ), 49 setString( ), 76 Simba Technologies, Inc., 33 single quotation marks ('), 19 skeletons and remote method calls, 112 Socket class, 162 sockets, 162-164 custom socket factories, 162 Software AG, 33 Solid Information Technology, 33 source code reuse, 132 special exception, remote methods, 113 SQL language, 10, 19-23 arrays, 75, 227-229 Java datatypes, mapping, 44-46, 77 NULL vs. Java null, 40 prepared statements, 57-59 SQL2, 23 datatype support, 44, 71 SQL3, 24 array objects, 227-229 datatype mappings, 45 datatype support, 76 structured types, 287 SQL/92, 23 stored procedures, 60-62 transaction logic, 23 VARCHAR datatype, 44 SQLData class, 277 SQLException class, 50 SQLInput class, 279 SQLJ paradigm, 34 SQLOutput class, 280-282 SQLWarning class, 51 SSL (secure socket layer) sockets, 162 StarQuest Software, 33 Statement class, 39, 282-287 batch processing, 64 execute( ) and, 80 PreparedStatement interface and, 58 when to use, 63 store( ), persistence delegate pattern and, 143, 196 stored procedures, 10, 60-62 vs. prepared statements, 63 Struct class, 76, 287 STRUCT type (SQL), 76 stubs and remote method calls, 112 subqueries, 22 Support class (full source code), 197-205 support classes, 50 Swing API, 138, 208-223 distributed listeners, 219-221 event queues, 209 handling long-lived events, 209 model-delegate architecture, 208 multithreading in, 209 MVC (model-view-controller), 208 three-tier database applications, 215-219 tree component support, 215 two-tier database application, 210-215 UI delegates, 208 monitoring models for changes, 219-221 worker threads, 221-223 SwingUtilities class, 209 Sybase, 8, 33 Symantec, 8, 33 system administrator, EJB, 118 T[ Top ] TableModel mode, 211 Telephony API, 8 ThinWeb SoftWare, 33 threads, Swing API, 209 three-tier architecture, 133-136 banking application, 143 centralized data processing, 134 data presentation, 135 drawbacks to, 136 Network Application Architecture, 136 three-tier database applications, 215-219 Thunderstone, 8 Time class, 51, 288 Timestamp class, 51, 289-291 tjFM, 33 /tmp/jdbc directory, 107 tokens, identity, 157, 160 Transaction class, 166-169 generic transaction logic (code example), 186-192 transaction isolation, 70 transaction management, 10 EJB (Enterprise JavaBeans), 165-170 TRANSACTION_NONE, 70 TRANSACTION_READ_COMMITTED, 70 TRANSACTION_READ_UNCOMMITTED, 70 TRANSACTION_REPEATABLE_READ, 71 transactions, 23 aborting (see ROLLBACKs) boundaries, 166 deadlocks, 170 distributed, 99-101 exception handling, 167 permanent (see COMMITs) persistence and, 183-193 RMI, no built-in support for, 117 tracking changes to, 167-169, 185 visibility issues, 70 TRANSACTION_SERIALIZABLE, 71 tree components, Swing support for, 215 TreeModel class, 208 three-tier database application, 215 TreeNode implementations, 215 Trifox, Inc., 33 two-phase commits, 165 two-tier architecture, 129-133 fat-client systems, 131 limitations to, 131 object reuse, 132 using Java with, 130 when to use, 133 two-tier database applications, 210-215 type mapping system, JDBC 2.0, 77 TYPE_FORWARD_ONLY result set, 46 type-map object, 77 Types class, 50, 77, 291 TYPE_SCROLL_INSENSITIVE result set, 46, 69 TYPE_SCROLL_SENSITIVE result set, 46, 69 U[ Top ] UI delegates, Swing API, 208 monitoring models for changes, 219-221 UML diagrams, 127 component transactions, 186 composite pattern, 140 distributed listener pattern, 139 mid-tier business objects, 144 unencrypted passwords, 160 UnicastRemoteObject class, 111 providing custom socket factories, 164 Unicode, Java strings, 8 Unified Modeling Language (see UML diagrams) uniform resource locators (see URLs) unique identifiers, distributed components, 149-156, 170-172 unmarshaling, remote method calls, 112 updatable result sets (see result sets, updatable) UPDATE statement, 21 updateRow( ), 68 URLs, 29, 35 binding objects to, 109 RMI (Remote Method Invocation), 109 URL lookups, 111 using JDBC 2.0 Optional Package, 92 user interface, 207-223 accessibility issues, 9 banking application, 145 business objects and, 135 client patterns and, 138 V[ Top ] validation, component security, 161 VARBINARY datatype, 72 VARCHAR datatype, 44, 72 vendors, JDBC driver, 31-33 views (GUI widgets), 208 visibility of changes, updatable result sets, 69-71 Visigenic, 33 W[ Top ] warnings, JDBC, 51 wasNull( ), 41 WHERE clause, 21 Wittgenstein, Ludwig, xvi, 126, 183 worker threads, Swing API, 221-223 WorkerThread object, 221 X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
S[ Top ] Sartre, Jean-Paul, xvi, 207 SAS Institute Inc., 8, 33 save( ), 220 SCO, 8, 33 scrollable result sets (see result sets, scrollable) SearchBinding class, 171 SearchCriteria class, 171, 205 searching for objects (see lookup, objects) using the persistence delegate, 197-206 secure socket layer (SSL) sockets, 162 Security API, 8 security issues components authentication, 156-161 identity tokens, 157, 160 unencrypted passwords, 160 validation, 161 databases, 164 distributed systems, 156-164, 167-169 networks, 162-164 RMI (Remote Method Invocation), 116 SELECT statement, 22, 39-43 (see also queries) sequence generators, ID generation, 149-156 SequenceGenerator class, code examples, 150-152, 153-156 Serializable interface, 115 serialization, object, 114-116 Server API, 8 server provider, EJB, 118 service providers, JNDI, 106 servlets, Java, 8 session beans, 119 (see also process-oriented components) SessionBean method, 121 setAutoCommit( ), 42 setBlob( ), 73 setClob( ), 73 setFetchDirection( ), 49 setFetchSize( ), 49 setString( ), 76 Simba Technologies, Inc., 33 single quotation marks ('), 19 skeletons and remote method calls, 112 Socket class, 162 sockets, 162-164 custom socket factories, 162 Software AG, 33 Solid Information Technology, 33 source code reuse, 132 special exception, remote methods, 113 SQL language, 10, 19-23 arrays, 75, 227-229 Java datatypes, mapping, 44-46, 77 NULL vs. Java null, 40 prepared statements, 57-59 SQL2, 23 datatype support, 44, 71 SQL3, 24 array objects, 227-229 datatype mappings, 45 datatype support, 76 structured types, 287 SQL/92, 23 stored procedures, 60-62 transaction logic, 23 VARCHAR datatype, 44 SQLData class, 277 SQLException class, 50 SQLInput class, 279 SQLJ paradigm, 34 SQLOutput class, 280-282 SQLWarning class, 51 SSL (secure socket layer) sockets, 162 StarQuest Software, 33 Statement class, 39, 282-287 batch processing, 64 execute( ) and, 80 PreparedStatement interface and, 58 when to use, 63 store( ), persistence delegate pattern and, 143, 196 stored procedures, 10, 60-62 vs. prepared statements, 63 Struct class, 76, 287 STRUCT type (SQL), 76 stubs and remote method calls, 112 subqueries, 22 Support class (full source code), 197-205 support classes, 50 Swing API, 138, 208-223 distributed listeners, 219-221 event queues, 209 handling long-lived events, 209 model-delegate architecture, 208 multithreading in, 209 MVC (model-view-controller), 208 three-tier database applications, 215-219 tree component support, 215 two-tier database application, 210-215 UI delegates, 208 monitoring models for changes, 219-221 worker threads, 221-223 SwingUtilities class, 209 Sybase, 8, 33 Symantec, 8, 33 system administrator, EJB, 118 T[ Top ] TableModel mode, 211 Telephony API, 8 ThinWeb SoftWare, 33 threads, Swing API, 209 three-tier architecture, 133-136 banking application, 143 centralized data processing, 134 data presentation, 135 drawbacks to, 136 Network Application Architecture, 136 three-tier database applications, 215-219 Thunderstone, 8 Time class, 51, 288 Timestamp class, 51, 289-291 tjFM, 33 /tmp/jdbc directory, 107 tokens, identity, 157, 160 Transaction class, 166-169 generic transaction logic (code example), 186-192 transaction isolation, 70 transaction management, 10 EJB (Enterprise JavaBeans), 165-170 TRANSACTION_NONE, 70 TRANSACTION_READ_COMMITTED, 70 TRANSACTION_READ_UNCOMMITTED, 70 TRANSACTION_REPEATABLE_READ, 71 transactions, 23 aborting (see ROLLBACKs) boundaries, 166 deadlocks, 170 distributed, 99-101 exception handling, 167 permanent (see COMMITs) persistence and, 183-193 RMI, no built-in support for, 117 tracking changes to, 167-169, 185 visibility issues, 70 TRANSACTION_SERIALIZABLE, 71 tree components, Swing support for, 215 TreeModel class, 208 three-tier database application, 215 TreeNode implementations, 215 Trifox, Inc., 33 two-phase commits, 165 two-tier architecture, 129-133 fat-client systems, 131 limitations to, 131 object reuse, 132 using Java with, 130 when to use, 133 two-tier database applications, 210-215 type mapping system, JDBC 2.0, 77 TYPE_FORWARD_ONLY result set, 46 type-map object, 77 Types class, 50, 77, 291 TYPE_SCROLL_INSENSITIVE result set, 46, 69 TYPE_SCROLL_SENSITIVE result set, 46, 69 U[ Top ] UI delegates, Swing API, 208 monitoring models for changes, 219-221 UML diagrams, 127 component transactions, 186 composite pattern, 140 distributed listener pattern, 139 mid-tier business objects, 144 unencrypted passwords, 160 UnicastRemoteObject class, 111 providing custom socket factories, 164 Unicode, Java strings, 8 Unified Modeling Language (see UML diagrams) uniform resource locators (see URLs) unique identifiers, distributed components, 149-156, 170-172 unmarshaling, remote method calls, 112 updatable result sets (see result sets, updatable) UPDATE statement, 21 updateRow( ), 68 URLs, 29, 35 binding objects to, 109 RMI (Remote Method Invocation), 109 URL lookups, 111 using JDBC 2.0 Optional Package, 92 user interface, 207-223 accessibility issues, 9 banking application, 145 business objects and, 135 client patterns and, 138 V[ Top ] validation, component security, 161 VARBINARY datatype, 72 VARCHAR datatype, 44, 72 vendors, JDBC driver, 31-33 views (GUI widgets), 208 visibility of changes, updatable result sets, 69-71 Visigenic, 33 W[ Top ] warnings, JDBC, 51 wasNull( ), 41 WHERE clause, 21 Wittgenstein, Ludwig, xvi, 126, 183 worker threads, Swing API, 221-223 WorkerThread object, 221 X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
T[ Top ] TableModel mode, 211 Telephony API, 8 ThinWeb SoftWare, 33 threads, Swing API, 209 three-tier architecture, 133-136 banking application, 143 centralized data processing, 134 data presentation, 135 drawbacks to, 136 Network Application Architecture, 136 three-tier database applications, 215-219 Thunderstone, 8 Time class, 51, 288 Timestamp class, 51, 289-291 tjFM, 33 /tmp/jdbc directory, 107 tokens, identity, 157, 160 Transaction class, 166-169 generic transaction logic (code example), 186-192 transaction isolation, 70 transaction management, 10 EJB (Enterprise JavaBeans), 165-170 TRANSACTION_NONE, 70 TRANSACTION_READ_COMMITTED, 70 TRANSACTION_READ_UNCOMMITTED, 70 TRANSACTION_REPEATABLE_READ, 71 transactions, 23 aborting (see ROLLBACKs) boundaries, 166 deadlocks, 170 distributed, 99-101 exception handling, 167 permanent (see COMMITs) persistence and, 183-193 RMI, no built-in support for, 117 tracking changes to, 167-169, 185 visibility issues, 70 TRANSACTION_SERIALIZABLE, 71 tree components, Swing support for, 215 TreeModel class, 208 three-tier database application, 215 TreeNode implementations, 215 Trifox, Inc., 33 two-phase commits, 165 two-tier architecture, 129-133 fat-client systems, 131 limitations to, 131 object reuse, 132 using Java with, 130 when to use, 133 two-tier database applications, 210-215 type mapping system, JDBC 2.0, 77 TYPE_FORWARD_ONLY result set, 46 type-map object, 77 Types class, 50, 77, 291 TYPE_SCROLL_INSENSITIVE result set, 46, 69 TYPE_SCROLL_SENSITIVE result set, 46, 69 U[ Top ] UI delegates, Swing API, 208 monitoring models for changes, 219-221 UML diagrams, 127 component transactions, 186 composite pattern, 140 distributed listener pattern, 139 mid-tier business objects, 144 unencrypted passwords, 160 UnicastRemoteObject class, 111 providing custom socket factories, 164 Unicode, Java strings, 8 Unified Modeling Language (see UML diagrams) uniform resource locators (see URLs) unique identifiers, distributed components, 149-156, 170-172 unmarshaling, remote method calls, 112 updatable result sets (see result sets, updatable) UPDATE statement, 21 updateRow( ), 68 URLs, 29, 35 binding objects to, 109 RMI (Remote Method Invocation), 109 URL lookups, 111 using JDBC 2.0 Optional Package, 92 user interface, 207-223 accessibility issues, 9 banking application, 145 business objects and, 135 client patterns and, 138 V[ Top ] validation, component security, 161 VARBINARY datatype, 72 VARCHAR datatype, 44, 72 vendors, JDBC driver, 31-33 views (GUI widgets), 208 visibility of changes, updatable result sets, 69-71 Visigenic, 33 W[ Top ] warnings, JDBC, 51 wasNull( ), 41 WHERE clause, 21 Wittgenstein, Ludwig, xvi, 126, 183 worker threads, Swing API, 221-223 WorkerThread object, 221 X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
U[ Top ] UI delegates, Swing API, 208 monitoring models for changes, 219-221 UML diagrams, 127 component transactions, 186 composite pattern, 140 distributed listener pattern, 139 mid-tier business objects, 144 unencrypted passwords, 160 UnicastRemoteObject class, 111 providing custom socket factories, 164 Unicode, Java strings, 8 Unified Modeling Language (see UML diagrams) uniform resource locators (see URLs) unique identifiers, distributed components, 149-156, 170-172 unmarshaling, remote method calls, 112 updatable result sets (see result sets, updatable) UPDATE statement, 21 updateRow( ), 68 URLs, 29, 35 binding objects to, 109 RMI (Remote Method Invocation), 109 URL lookups, 111 using JDBC 2.0 Optional Package, 92 user interface, 207-223 accessibility issues, 9 banking application, 145 business objects and, 135 client patterns and, 138 V[ Top ] validation, component security, 161 VARBINARY datatype, 72 VARCHAR datatype, 44, 72 vendors, JDBC driver, 31-33 views (GUI widgets), 208 visibility of changes, updatable result sets, 69-71 Visigenic, 33 W[ Top ] warnings, JDBC, 51 wasNull( ), 41 WHERE clause, 21 Wittgenstein, Ludwig, xvi, 126, 183 worker threads, Swing API, 221-223 WorkerThread object, 221 X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
V[ Top ] validation, component security, 161 VARBINARY datatype, 72 VARCHAR datatype, 44, 72 vendors, JDBC driver, 31-33 views (GUI widgets), 208 visibility of changes, updatable result sets, 69-71 Visigenic, 33 W[ Top ] warnings, JDBC, 51 wasNull( ), 41 WHERE clause, 21 Wittgenstein, Ludwig, xvi, 126, 183 worker threads, Swing API, 221-223 WorkerThread object, 221 X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
W[ Top ] warnings, JDBC, 51 wasNull( ), 41 WHERE clause, 21 Wittgenstein, Ludwig, xvi, 126, 183 worker threads, Swing API, 221-223 WorkerThread object, 221 X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
X[ Top ] XAConnection interface, 314 XADataSource interface, 315 XDB Systems, Inc., 8, 33 X/OPEN SQL Call Level Interface (CLI), 26 Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
Y[ Top ] Yard Software GmbH, 33 Z[ Top ] zero-install clients, 12
Z[ Top ] zero-install clients, 12