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.