
Java Database Class Libraries
By Kay Ewbank
Internet Systems, May 1997
Understanding the Four Types of Java Database Drivers
In theory, developing a Java application is a fairly easy process. The language is simple and the goals are obvious. If you want to write a database application, however, you need some way to request data from the database.
What you need is a database driver and a set of Java classes to make calls to the driver. At the moment, there are four basic styles of Java database driver: an ODBC driver in combination with a JDBC/ODBC bridge, a native-API partly Java driver, a native-protocol all-Java driver, and a Net-protocol all-Java driver. Net-protocol drivers take your JDBC calls and translate them into a net protocol that is DBMS independent. This intermediate Net protocol request is then converted into a specific DBMS protocol by the Web server. In contrast, a native-protocol driver converts the JDBC calls into the protocol of the specific DBMS without the intermediate step. In an ideal world, you would probably want to use a Net-protocol all-Java driver or a native-protocol all-Java driver, because these can be downloaded over the Net and interpreted at run time within Web browsers. The Net-protocol variety has the added advantage of being database vendor-independent, so you have complete freedom.
There are many options if you decide to go for the ODBC driver with a JDBC/
ODBC bridge; there are 10 or 12 drivers that combine native API drivers with the Java bridge. The rarer beasts are the Net protocol all-Java drivers, and the rarest of all are native-protocol all-Java drivers. At the time of writing, only a few companies offer these, the best known of which are Borland International Inc.'s InterClient, Connect Software Inc.'s FastForward, Sybase Inc.'s jdbcConnect, and SAS Institute Inc.'s SAS/SHARE*NET Driver for JDBC, although many others are under development.
The simplest driver, and the easiest to go for, is the JDBC/ODBC bridge. This has the advantage that you can use existing ODBC drivers, which are readily available and thoroughly tested. You write your applications in a JDBC-
compliant way, and the bridge converts your JDBC calls to ODBC calls. The best-known bridge is DataDirect, jointly developed by JavaSoft (a division of Sun Microsystems Inc.) and Intersolv Inc. DataDirect is available free on the JavaSoft Web site at splash.javasoft.com/jdbc/index.shtml#The JDBC-ODBC Bridge Driver or from the Intersolv Web site at www.Intersolv.com/products/demo-dd-jdbc.htm. If you want to use DataDirect with a downloaded applet, as opposed to with an application that runs outside a browser, the client must have Intersolv's Netscape Bridge and be using Netscape Communication Corp.'s Netscape Navigator rather than Microsoft Corp.'s Internet Explorer.
The main problem with JDBC/ODBC bridges is that they are they are not packaged as any kind of downloadable applet or control. This means that they can't be downloaded from the Net and used within Web browsers, so you need some additional software installed on the client machine to make full use of them.
A large number of libraries are currently under development, and those that have versions available are already being upgraded. Because of the rapid rate of development, some of these versions will have moved on by the time you read this, but here is a sample of the best available at the moment.
ActiveWeb
Cyber SQL Corp.'s ActiveWeb is a Java database class library that is available with Informix, Oracle, and Sybase databases, using JDBC for the Web requests. The classes include data-aware versions of simple and more complex controls, including grids, list boxes, radio buttons, and combo boxes. The applications you build can store transactions and query earlier transactions. You can choose between manual and automatic commits, carry out SQL validations, and create cross-column validations. There are form and report layout designers, and the next version will add transaction locking, cooperative transactions, and background query threading. The current form designer lets you set up active multimedia elements, and you can create context-sensitive tab orders and help files.
The client portion of ActiveWeb is downloaded the first time a remote user accesses the application, and the server component runs on your Web server, with native drivers for Oracle, Sybase, and Informix.
dbAnywhere
Symantec Corp.'s dbAnywhere comes with sample JDBC code to show you how to get started. It uses a three-tier architecture and has drivers for Oracle, Microsoft SQL Server and Access, Sybase, and Watcom. The Intersolv ODBC driver is also supported. dbAnywhere is fully compliant with JDBC 1.01.
Future versions of dbAnywhere are in beta at the moment, and they should add compliance with JDBC 1.1, BLOB support, Oracle and Sybase connectivity from NT and Windows 95, and a single Oracle95 and OracleNT driver. If you want to work in a more integrated environment, Symantec's Visual Café Pro includes an embedded version of dbAnywhere Workgroup Server.
JDesigner Pro
Symantec JDesigner Pro is a client/server interface designer, builder, and code generator from Bulletproof Corp. that uses ODBC as the data driver. The builder has components for forms, grids, charts, and reports, as well as the ability to create search and sort panels. JDesignerPro includes and is built around BulletProof's JAGG server. JAGG is a Java ODBC engine that supports JDBC. It consists of a Java client element and a server-side component. JAGG is also available separately and runs either as a CGI script on the Web server or on a standalone server.
JETConnect
JETConnect from XDB Systems Inc. is one of a range of JET (Java Enterprise Tools) products from XDB. JETConnect is a set of Java classes and drivers giving GUI data controls and a programming interface that will look fairly familiar to anyone used to embedded SQL. Its data-aware controls facilitate the creation of both query-by-form and update-by-form applications. There are data-aware versions of AWT's (the Abstract Windowing Toolkit, part of the Java API) text areas and text boxes, menus, check boxes, groups, and list boxes. In addition, JETConnect has grids, image fields, and methods for Select First, Next, and Prior; Prepare Insert, Delete, and Select; and Commit and Rollback. A query-by-forms option converts the search criteria into SQL select statements, including master-detail queries, and you can also create update-by-form facilities.
JETConnect implements ODBC as a set of Java classes, and it also has a JDBC interface that translates JDBC requests to their ODBC equivalent. If, as is likely, you create Java applets that talk to databases, there's a database-access server. The ODBC drivers stay on the server, so there's no requirement to download them to the client. Although JETConnect supports JDBC, the preferred solution is to use ODBC because of the larger amount of features supported, including backward-scrollable cursors, variable binding, and block reads.
NetServer
Agave Software Design's JDBC NetServer consists of a CORBA JDBC server and a JDBC client with data-aware classes. The client runs in a Web browser, and it consists of a set of Java classes that send database requests to the JDBC server running on the Web server. You can connect to multiple databases and tables, either on or off the Web server. Currently, the library works with Informix, Oracle, Sybase, and ODBC. Other drivers are under development.
OPENjdbc
OPENjdbc from I-Kinetics Inc. combines a pure Java client a choice of CORBA-based servers connected via IIOP. The servers you can choose from are either DataBroker, a pure CORBA JDBC server with both native drivers and ODBC drivers, or the OPENjdbc server that has native JDBC drivers for IBM, Oracle, and Sybase. OPENjdbc comes with IONA's Orbix runtime.
If you don't want to use Java, the servers have a CORBA IDL interface that lets you use other languages such as C++, Smalltalk, or ADA. The CORBA servers also offer an interface repository, multithreading, and support for CORBAservices. This gives support for more sophisticated data manipulation, including triggers and query caching.
O2 Relational Binding
A rather different approach to the other libraries here is offered by the O2 Java Relational Binding (JRB) from O2 Technology. Instead of concentrating on using Java to access normal relational data, JRB provides a way to handle persistent Java objects, with tools that let you create and store persistent Java objects in relational databases. JRB consists of a development tool and a runtime environment. The development tool takes your Java classes and creates the equivalent relational schema for your database. Methods are generated to read and write the Java objects when the runtime version makes requests to access them. The runtime version of JRB manages an object cache and runs on a JDBC-compliant layer.
So Much Choice...
The range of drivers available should convince you that although plain-vanilla Java might lack the tools necessary to develop powerful database applications, you won't be hampered by a lack of tools. What's even better is that if you can't find exactly the driver you need, it will almost certainly be along soon. With Web time being what it is, you get the same number of products in 12 to 13 weeks that would appear in a year in normal software development. New versions of existing drivers appear almost daily, and many companies are working hard on exciting new alternatives. The future's bright, and the future's Java.
Kay Ewbank is an independent computer analyst based in the United Kingdom, where she designs and develops databases and lectures on programming. She is also a contributing editor of Program Now, a U.K.-based magazine for professional developers, as well as a regular contributor to D3, The Independent, Computer Shopper, and the U.K. edition of DBMS. You can email Kay at infomax@cix.compulink.co.uk.
* The JavaSoft drivers chart at splash/javasoft.com/jdbc/jdbc.drivers.html lists the drivers mentioned here as well as alternatives from companies such as Web Logic, IDS, and DataRamp. You can also refer to the product chart on page S14.
Subscribe to DBMS and Internet Systems -- It's free for qualified readers in the United States
May 1997 Internet Systems Table of Contents | Other Contents | Article Index | Search | Site Index | Home
DBMS and Internet Systems (http://www.dbmsmag.com)
Copyright © 1997 Miller Freeman, Inc. ALL RIGHTS RESERVED
Redistribution without permission is prohibited.
Please send questions or comments to dbms@mfi.com
Updated Monday, April 14, 1997