Java has caused great excitement with its ability to animate Web pages. However, Java is a full-fledged programming language that is arguably the only language suitable for net-centric business applications. The vast majority of business applications require database access and we can expect Java applications to be no different.
JavaSoft created the JDBCª (Java Database Connection) specification, recognizing the urgency of a standard DBMS API for Java. JDBC enables the Java developer to connect to a SQL-capable data source, send SQL statements to the data source and return status messages and data records resulting from the SQL execution. JDBC also offers advanced functionality such as automatic conversion of different database data types to Java data types, the streaming of large data records, cursors and multiple result data sets.
JavaSoft has taken the first step towards assuring conformance of JDBC implementations with the "JDBC COMPLIANTª" designation. To use this designation, a JDBC driver must support the ANSI SQL 2 Entry Level standard and have passed the conformance tests provided by JavaSoft . JDBC offers the business application true platform and database-independent access to the current investment in databases.
At last count, there were over twenty different JDBC implementations available from a number of vendors . I will explore the major architectural approaches for implementing JDBC for networked application and then demonstrate how a JDBC implementation based on CORBA and IIOP realizes the best features of all of these different approaches.
JDBC uses a class hierarchy for database objects that is in the java.sql.* package of the JDK 1.1. The "JDBC Guide: Getting Started" presents an excellent detailed coverage of the JDBC classes and how to use them . There are four major areas of functionality of a JDBC driver implementation.
Since JDBC is a specification, there is considerable freedom for each vendor to distinguish itself on its strategy for implementing each of these major functional areas as well as extra value extensions. All these strategies divide themselves into one of two categories: client-centric or net-centric JDBC drivers.
- DBMS Connection: Manage the connection to a database
- SQL: Transmit and manage submission of SQL to the DBMS for execution.
- Exception Management: Manage exception and status events resulting from SQL execution
- Data Transmission: Marshall data output from database, transport it back to requesting JDBC client and convert from native database data types to Java data types.
The Client-Centric JDBC Driver
The client-centric JDBC driver is located entirely on the local client platform. Client-centric JDBC drivers take advantage of existing Microsoft Open Database Connectivity (ODBC) or DBMS vendor-specific drivers because of the wide availability and established installed base. See Figure 1 for a typical client-centric JDBC driver architecture.
A significant drawback of using the installed base of ODBC or vendor-specific drivers is that they are not pure-Java implementations. For reasons of security, many browsers do not allow or place very stringent limitations on access to foreign binaries. For example, Netscape Navigator 3.x or Communicator 4.x require that any Windows or UNIX binary be implemented using the Netscape Java Runtime Interface (JRI). The installed base of ODBC drivers on Windows desktops and any JDBC driver then uses ODBC drivers cannot be accessed from Netscape browsers.
Sybase jdbcCONNECT is a notable exception to the current crop of client-centric JDBC drivers. Sybase has created a pure Java implementation of their proprietary Tabular Data Stream (TDS) protocol. Running on top of the TCP/IP network protocol, TDS enables jdbcCONNECT to directly access Sybase SQL Server, Replication Server and OmniCONNECT. jdbcCONNECT should have a relatively high performance compared to ODBC drivers.
In general, throughput performance in a distributed system is determined by how many times the data must be copied as it travels from source to destination. The more middleware layers to transverse, the more times a data packet is copied, resulting in a lower throughput performance. You can expect that the database vendors will have a natural advantage in providing the fastest drivers for their databases.
- Client-centric JDBC/ODBC drivers distinguish themselves by a very low cost of entry. ODBC drivers are a de-facto standard for PC database access. Java applications can use the same local driver used by the current client-server installed base.
- ODBC supports a wide range of databases at a very low cost. Windows 95 and Windows NT includes ODBC drivers for Access, dBASE, Foxpro, Paradox, Excel, and Microsoft SQL Server. Intersolv offers ODBC drivers for over twenty databases, including Informix, Ingres, Oracle, and Sybase for a very low price.
The Net-Centric JDBC Driver
- A JDBC driver that is not a pure Java implementation, such as a JDBC/ODBC hybrid, will not work with a Web browser.
- Applets that use client-centric JDBC are restricted to databases located on the Web server from which the applet originated.
- Client-centric JDBC driver installations have a very high cost of ownership. Each client platform must install, administrate and maintain a set of drivers for accessing databases. Rapidly evolving browsers, Java SDK, Java class libraries and Intranet security cause rapid obsolescence of a local driver installation. Additionally, new DBMS versions will usually require updates for all JDBC driver installations.
The net-centric JDBC driver avoids all the disadvantages of non-Java binaries by separating the JDBC driver into a JDBC Server and a pure-Java JDBC Client. The JDBC Client implements the minimum necessary logic to pass SQL over the network to the JDBC Server and receive the data back. The JDBC Server manages the direct connection to the DBMS, manages any exception and status events resulting from SQL execution and finally packages the data for transmission over the network to the JDBC Client.
The JDBC Client usually has a small footprint of 200KB or less. Most of the Java code of the JDBC Client implementation is dedicated to unpacking the data received from the JDBC Server from network packets into Java data types. See Fiugre 2 for a typical net-centric JDBC driver architecture.
The net-centric JDBC driver has all the benefits of a three-tier architecture. Access control, load-balancing, DBMS-specific extensions, encryption and compression can be implemented at the JDBC Server tier between the JDBC Client and the DBMS.
The net-centric architecture is particularly suitable for enterprise applications that have demanding performance and scalability requirements. Multiplexing management among several replicated databases is best done by the JDBC Server. Products are appearing on the market that support data warehouse features such as catalog and query caches. Other JDBC enterprise features include DBMS connection caching, logging and administration facilities.
XDB's JetExpress is one of the first products to market with a multi-tier JDBC architecture. JetExpress has a pure Java JDBC Client that also offers an ODBC API. The ODBC API offers functionality missing in the JDBC specification, such as block reads, backward scrolling cursors, and variable binding. The JetExpress JDBC server offers database connectivity via ODBC drivers and a XDB-based gateway to DB2/MVS and other DRDA compliant data sources. JetExpress offers a high performance catalog by creating an image of the target database's system catalog tables on the gateway. XDB reports cases of application speedup of more than 300%.
The Internet and the enterprise Intranet have introduced a new problem, rarely encountered by the LAN-based client/server application - the firewall. All untrusted protocol connections are blocked at a properly configured firewall. Specific Internet protocols, such as HTTP, FTP and SMTP are "trustworthy" because they have specific proxies that filter, control and log protocol traffic for a specific TCP/IP port across the firewall. Unfortunately, each JDBC implementation requires the development of a new proxy as the protocol exchange between JDBC client, JDBC server and DBMS is unique.
If a proxy is not available for your brand of JDBC, then firewall security must be relaxed so that a JDBC application can access an enterprise database behind the firewall. Of course, it is a rare organization that can allow a compromised firewall configuration. You can expect JDBC to be blocked at the first firewall it encounters.
- Net-centric JDBC driver installations have a lower cost of ownership than client-centric JDBC drivers. A pure Java JDBC client implementation has all the advantages of Java's "Write-once, Run Anywhere" administration and maintenance benefits. It is installable, portable and secure on all Java capable platforms, including new network computers from Sun and Oracle.
- Applets that use the JDBC Client are restricted only to a JDBC Server located on the Web server from which the applet originated. The JDBC Server may in turn access databases that are not on the Web server.
- Net-centric JDBC drivers have a three-tier architecture that is suitable for demanding enterprise applications. Compression, encryption, DBMS connection caching, query caching, logging, administration, access control, load-balancing and DBMS- specific extensions are implemented at the JDBC Server tier between the JDBC Client and the DBMS.
The CORBA-Based JDBC Driver
- A pervasive problem with all JDBC products is firewall security. Firewall proxies are usually not available for the specific JDBC implementation. The enterprise is faced with the difficult choice of prohibiting access to enterprise databases behind the firewall or compromising firewall security. A third undesirable alternative is accepting a substantial reduction of quality of service using HTTP tunneling.
A substantial amount of a net-centric JDBC driver implementation is dedicated to the communication between its distributed components. Establishing connections, handling a dirty client, packing and unpacking data from the wire, is all more or less accomplished by programming directly at the TCP/IP socket level. JDBC drivers would benefit greatly from being implemented on a pervasive distributed computing infrastructure.
CORBA¨ (Common Object Request Broker Architecture) is a widely implemented and deployed infrastructure on which we can build Java-based net-centric applications . CORBA represents a paradigm shift in middleware Ð an industry-wide agreement on distributed object interaction protocols and framework services. The promise of the CORBA-based applications is to enable developers to "snap together" applications by mixing and matching prefabricated "plug & play" software components. CORBA-based component software is universally accessible and interoperates across boundaries of operating systems, networks, languages, development tools and interface styles.
The net-centric JDBC driver migrated to CORBA becomes an assembly of collaborating components. The CORBA Interface Definition Language (IDL) is used to define a JDBC Server's interface. The CORBA JDBC Server provides operating system and programming language independent interfaces to all the services and clients that reside on a CORBA distributed object bus. See Figure 3 for a typical CORBA-based net-centric JDBC driver architecture.
The CORBA JDBC Server interface specification is available at runtime or compile-time from the CORBA Interface Repository. This is an essential feature for component software to be able to bind together at run-time. Also, interface self-description is an essential capability for JavaBeans and realizing component reusability.
The Internet Inter-ORB Protocol (IIOP) is an emerging de-facto standard candidate for ubiquitous inter-object communication protocol for all CORBA implementations using TCP/IP. IIOP was originally motivated to standardize interoperability between different CORBA vendor implementations. However, IIOP has been rapidly adopted because it defines a standard set of message contents, formats and semantics for transmitting requests and replies between objects. Given the specification of an object's methods and data structures, it manages all the packing and unpacking of the method call and object data structures. IIOP is a separable CORBA runtime service and is fast, reliable and has a very small footprint.
Leading CORBA vendors, such as IONA, IBM, Sun and Expersoft have shipping IIOP implementations, while other CORBA suppliers, such as DEC and HP, have announced release commitments. By providing free versions of Java IIOP implementations, Netscape and IONA Technologies have taken a leadership role in providing a high performance, open standard, inter-object communication protocol for the Intranet and Internet distributed application.
Earlier, we discovered that proprietary JDBC connection protocols are blocked at the first firewall encountered. Undesirable workarounds suffer from reduction of quality of service using HTTP tunneling or having to relax firewall security. IIOP-based JDBC implementations eliminate the firewall problem. Since IIOP is fast becoming a de facto Internet connection protocol, you can expect IIOP firewall proxies to be widely deployed.
I-Kinetics' OPENjdbc is the first CORBA-based JDBC product to appear on the market. OPENjdbc is a pure Java JDBC client that connects via IIOP to the DataBrokerª, a CORBA JDBC Server. The product ships with IONA's CORBA 2.0 and IIOP compliant Orbix runtime. IIOP firewall proxy support is provided by IONA's Wonderwall, which offers trustworthy access management and logging at the object method level. Figure 4 shows the architecture for OPENjdbc, a pure CORBA net-centric JDBC driver.
DataBroker provides a CORBA IDL interface assuring multi-language, platform-independent interface to all CORBA capable services and applications. In addition to Java, the JDBC IDL interface supports C, C++, SmallTalk, ADA and any other language for which an IDL compiler is available. Multi-language support is crucial for integrating the existing enterprise investment as Java and non-Java components can be assembled to create multi-tier applications.
- Very low cost of ownership - The CORBA-based JDBC driver has all of Java's "Write-once, Run Anywhere" administration and maintenance benefits and all of CORBA's enterprise distributed computing infrastructure strengths. Server based pricing and no per user license costs eliminates client license management.
- Very low startup costs - The startup cost is the cost of a CORBA JDBC Server. A free CORBA JDBC Client license is available from I-Kinetics. An IIOP client license is free from IONA Technologies and is included in Netscape's Web browsers and Web servers as part of Open Network Environment (ONE).
- The high costs and risks of proprietary middleware and network protocols are eliminated. The use of open standards, such as IIOP, CORBA and Java, protects against being locked into a single platform or vendor solution. CORBA and IIOP are pervasively available on every leading desktop and server platform. Continual support and advancement of IIOP are insured by industry-wide adoption. Key areas where the IIOP specification is being advanced are firewall security, compression and network management.
- IIOP-based distributed applications can be securely and feasibly managed using the large installed base of firewalls. IIOP firewall proxies with advanced filter, control and logging features are available. For example, IONA's Wonderwall firewall proxy offers trustworthy access management and logging at the object method level.
- Advanced distributed computing features such as threading, directory services, interface repository and multi-language support are basic features of a CORBA-based JDBC implementation.
- The CORBA JDBC Server provides an IDL interface assuring multi-language, platform- independent interface to all CORBA capable services and applications. In addition to Java, the JDBC IDL interface supports C, C++, SmallTalk, ADA and any other language for which an IDL compiler is available.
- Advanced features such as DBMS server multiplexing, logging, query caching and triggers can be implemented using CORBAServices, such as Events, Transactions, Persistence, Concurrency and Externalization.
- JDBC extensions are required to provide type safety and higher performance through compile time use of DBMS schema. Currently, DBMS vendor support of SQL-based stored procedures can satisfy some of this need. A complete solution requires Java-based stored procedures and access to the DBMS internals.
JavaSoft created the JDBCª (Java Database Connection) specification, recognizing the urgency of a standard DBMS API for Java. JDBC enables the net-centric business application true platform and database independent access to the enterprise database investment.
CORBA-based JDBC will be among the first "killer applications" for the net-centric enterprise information system. It delivers the promise of significantly lower cost of ownership for enterprise systems. CORBA is quickly becoming pervasively available on every leading desktop and server platform in an extraordinarily short period of time. This is driven by the commitment of such technology leaders as IBM, I-Kinetics, IONA technologies, Netscape, Oracle and Sun. What is most significant is that Java and CORBA together provide a path for the enterprise to scale up existing client/server applications to very large, pervasively available, multi-tier net-centric applications.
- Pre-press copy of JDBC Developer Guide:
- XDB JetConnect Whitepaper
- You can obtain CORBA specifications in detail at http://www.omg.org as well as follow the latest specification developments in CORBAservices, such as Security, Event, Transaction, Persistence and Concurrency; CORBAfacilities, such as System Management, Workflow and Agents;CORBAdomains, such as CORBAmed (medical) and CORBAfinance.
- "IIOP on the Internet Whitepaper", IONA Technologies Ltd.
- JDBC Specification:
- Java Programmer Documentation:
Also, I highly recommend these two books for quickly and deeply developing your knowledge of CORBA:
"The Essential Distributed Objects Survival Guide", Robert Orfali, Dan Harkey and Jeri Edwards, John Wiley and Sons, Inc., 1996.
"CORBA Fundaments and Programming", Editor Jon Siegel, John Wiley and Sons, Inc.,1996.
About The Author
Dr. Cottman is founder and CEO of I-Kinetics and is founder and Chairman of the ComponentWare Consortium. As M.I.T. Lincoln Laboratory principal research staff, he designed and deployed one of the first distributed object management frameworks. As V.P of R&D at Symbiotics, he led the ACCESS and SOCIAL distributing computing projects, resulting in the successful pre-CORBA commercial products, MetaCourier and ObjectExpress. In 1991, Dr. Cottman became a CORBA convert, sold his Symbiotics holdings and formed I-Kinetics. I-Kinetics is a leading provider of CORBA-based enterprise component software and tools. He can be reached at [email protected]