Archives
 
 
 
  Special
 
 
 
  About Us
 
 
 

Newsletter
Free E-mail Newsletter from BYTE.com

 
    
           
Visit the home page Browse the four-year online archive Download platform-neutral CPU/FPU benchmarks Find information for advertisers, authors, vendors, subscribers

ArticlesJDBC's Growing Pains


May 1998 / Reseller / JDBC's Growing Pains

Java Database Connectivity is a step in the right direction but still too immature for some Java developers.

Alan Joch

Sun's JavaSoft division released the Java Database Connectivity (JDBC) specification, early in 1996, to define a collection of APIs for connecting Java applications to relational database management systems. Like its cousin ODBC ("O" is for "Open"), JDBC uses one common interface backed by DBMS-specific drivers and a driver manager that acts as traffic cop between applications and DBMSes.

To some degree, JavaSoft achieved its goal of providin g an open-systems way for clients to access databases. But some de velopers have grown frustrated with JDBC's slow evolution.

One developer with a love/hate attitude toward JDBC is Ward Mullins , president and chief technology officer of Thought, Inc. (San Francisco), a Java consultancy and middleware developer. One minute, he credits JDBC for being "functional and useful" at its core. The next, he calls the specification "a beta spec" because of its authors' lack of attention to details. "Working consistently across JDBC drivers is like herding cats: You can make them all move, but you can't make them go where you want them to go," he complains.

Until a new version of JDBC comes out -- maybe this spring -- resellers and integrators who want to merge Java applications with RDBMSes must rely on somewhat immature JDBC drivers and their own finesse in making applications work. Success often comes down to choosing the right driver type from the four de fined by JavaSoft (see "JDBC Driver Quartet") and picking the right JDBC tools from DBMS vendors, third-party driver sources, and middleware developers.

Database Direct

Major RDBMS vendors, including IBM and Oracle, ship custom JDBC drivers with their database products. These drivers supply the cross-platform connectivity inherent in the generic spec along with the capability to use special characteristics within their individual RDBMSes. For example, a custom driver for Oracle 8 might extend JDBC to support Oracle sequences.

Oracle supplies driver Types 2 and 4. Moe Fardoost, senior product manager for Oracle's Data Server Marketing Division, characterizes this support as the initial step in bringing Java connectivity into the Oracle realm. Type 2 is for heavyweight, three-tier architectures. "Type 2 drivers map JDBC to native

APIs in C/C++," Fardoost explains. "This gives you access to more functionality that's Oracle-specific." Type 4 drivers provide downloadable applets and bypass any translation layers by going directly from Java calls to the RDBMS using Java sockets.

The Internet and New Media Division of systems integrator EDS (Plano, TX) uses Oracle as its primary RDBMS for its Web-hosting services. Prior to JDBC, the division used CGI as a kind of broker for communications between clients and C programs or Perl scripts on the database server, explains Darryl Thomas, consultant and systems engineer. "JDBC is smoother at the process level," he says. "With JDBC, because you talk to other entries directly, you don't have to worry about script violations."

The division currently uses only Oracle's Type 4 JDBC drivers . "We stay away from the Type 2 driver because Oracle's implementation is only for Solaris, NT, and 95," Thomas explains. "That may be enough for some companies that are perhaps running an intranet with only Solaris or Windows clients. But our customers have many more different types of clients that we need to support."

For its part, IBM pr ovides two categories of JDBC drivers, based on driver Types 2 and 4, for DB2. The Type 2 relative, dubbed application drivers , translates JDBC calls from clients into call-level interface (CLI) calls, which then travel to the DB2 server via Client Application Enablement (CAE). CAE lets clients talk to DB2 servers, according to Judy Escott, IBM's manager of DB2 user-centered design and development. Application drivers differ from straight Type 2 drivers primarily in their support for DB2 CLI, the ODBC-like interface that takes advantage of DB2 capabilities such as object-relational support.

The second category, applet drivers , contains a "client" and a "server" component. The applet client component runs on Java-enabled Web browsers, while the applet server resides on the Web server alongside CAE.

Deciding to use applets or applications depends on a number of issues. Applets require only a Web browser (not CAE) on the client. This makes for a smaller client footprint and simplifies i nstallation and maintenance, especially for companies with a large number of clients. Because applets are Web-enabled, they're the best choice for Internet-based DB2 access, according to IBM's Escott. Applications fit the more traditional two-tier model: clients on a LAN accessing servers such as DB2. Performance is better because there is one less communication layer to deal with, she says. The DB2 CAE must be installed on each client.

JDBC drivers are "a natural way for Java programmers to get data through stored procedure calls that you can send over the network," says Jeff Jones, IBM's program manager for data management marketing. Nevertheless, it's not the only way, in IBM's view. Net.Data, which comes bundled with DB2, resides on a Web server and maps requests from Java apps to the database, using native RDBMS language.

Third-Party Solutions

Third-party driver vendors build any of the four driver types and add nuances not spelled out in the spec (see http://java.sun.com/products/jdbc/jdbc.drivers.html for a list of driver vendors). In the short term, driver vendors like WebLogic work to distinguish themselves by writing drivers that can pass more of the modules in JavaSoft's JDBC compatibility tests and by adding features beyond what the generic spec requires. For example, WebLogic says jdbcKona supports extended SQL and multibyte characters.

But a competitive advantage gained with extensions won't last forever, as RDBMS vendors continue to roll out newer versions of their JDBC drivers. "Over time, most people will probably buy their Type 2 drivers from the database vendors," concedes Scott Dietzen, WebLogic's vice president of marketing.

The future for driver vendors lies in Types 3 and 4, which offer benefits for application developers who want to create be tter-performing and more sophisticated Java/RDBMS applications. Type 3 drivers, which reside on an application server and communicate with all-Java clients, give Java applications the ability to read and write to an RDBMS anywhere on the network. Because Type 3 drivers work with all-Java clients, there are no C libraries to download, making this type best for browser-based access to RDBMSes. When evaluating commercial Type 3 drivers, you should judge according to how they extend the generic spec. For example, some drivers support IIOP, query caching, and pooling of database connections.

Type 4 drivers provide essentially the same capabilities as Type 2 interfaces but have the advantage of being all-Java.

A Step Forward

Many programmers emphasize that despite its flaws, JDBC is a positive step forward, especially with the help of RDBMS and third-party products that flesh out the spec. Few are unhappy about leaving behind the time-consuming alternatives, like writing CGI scripts, to marry Jav a applications and RDBMSes. As Jennifer McLean, a consultant with systems integrator Clarkston-Potomac (Durham, NC), puts it: "The advantage of using JDBC is that it's all one Java program, it's all object-oriented."


Where to Find


IBM

White Plains, NY
Phone:    770-863-1234
Fax:      770-863-3030
Internet: 
http://www.ibm.com



Sun Microsystems

Palo Alto, CA
Phone:    888-843-5282 (North America)
Phone:    512-434-1591 (Elsewhere)
Internet: 
http://java.sun.com/products/jdbc



Oracle

Redwood Shores, CA
Phone:    650-506-7000

Internet: 
http://www.oracle.com



Thought, Inc.

San Francisco, CA
Phone:    415-836-9199
Internet: 
http://www.thoughtinc.com



WebLogic

San Francisco, CA
Phone:    415-659-2600
Internet: 
http://www.weblogic.com


JDBC Driver Quartet

illustration_link (35 Kbytes)

JavaSoft's four kinds of JDBC drivers differ mainly between the JDBC driver and the database.


Ward Mullins

photo_link (60 Kbytes)

"Working consistently across JDBC drivers is like herding cats: You can make them all move, but you can't make them go where you want." -- Ward Mullins, Thought, Inc.


Alan Joch is a BYTE consulting editor. His e-mail address is ajoch@monad.net .

Up to the Reseller section contentsGo to previous article: Cracker Tracking: Tighter Security with Intrusion DetectionGo to next article: JDBC Driver Quartet
Flexible C++
Matthew Wilson
My approach to software engineering is far more pragmatic than it is theoretical--and no language better exemplifies this than C++.

more...

BYTE Digest

BYTE Digest editors every month analyze and evaluate the best articles from Information Week, EE Times, Dr. Dobb's Journal, Network Computing, Sys Admin, and dozens of other CMP publications—bringing you critical news and information about wireless communication, computer security, software development, embedded systems, and more!

Find out more

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE Volume 1: Programming Languages
The Best of BYTE
Volume 1: Programming Languages
In this issue of Best of BYTE, we bring together some of the leading programming language designers and implementors...

Copyright © 2005 CMP Media LLC, Privacy Policy, Your California Privacy rights, Terms of Service
Site comments: webmaster@byte.com
SDMG Web Sites: BYTE.com, C/C++ Users Journal, Dr. Dobb's Journal, MSDN Magazine, New Architect, SD Expo, SD Magazine, Sys Admin, The Perl Journal, UnixReview.com, Windows Developer Network