by Joe Sam Shirah
This article is provided for those readers of the JDBC 2.0 Fundamentals course who may be interested in how we went about determining which Database Management Systems ( DBMS ) would be used in the course. This research and discussion relates only to course goals. It is not definitive in any way, and should not be taken as a recommendation of one product over another, especially for use in a production environment.
From the Beginning
When I was approached about creating a JDBC 2.0 course, I felt very strongly that a standards-based DBMS should be used if at all possible. Virtually every other source has used MS Access and the JDBC-ODBC bridge for JDBC code examples. While understandable, that approach has some basic flaws for the JDBC programmer: Access is a fine tool, but it is not a DBMS, it is not standards oriented, and is platform specific. The JDBC-ODBC bridge is a good developer's toy, but has never made any claim to being production quality nor of supporting the entire API. An unfortunate result of including the bridge in the JDK has been that a number of developers try to use it in production, even at the enterprise level. Use of either, and almost certainly of both, outside their intended areas can lead to severe problems in professional applications. ( I am prepared to back up these assertions with articles and statements from MSDN, Sun, forums, email, FAQ questions, and personal experience. Anyone who would like to discuss this further can find me at Lynch's, located at Jacksonville Beach, Florida, on Thursday evenings. Be prepared to spring for several Double Diamonds. )
The criteria that I felt were most important in a DBMS suitable for the course were:
- JDBC 2.0 and support for part, if not all, of the Optional Package.
- Freely available, multi-platform developer's versions.
- Type 4 drivers.
- Reasonable download size.
- Reasonably easy to install, set up, and use.
It can't be stressed enough, and shows how the Internet, the Java programming language, competition, and other factors have changed computing, that just a few years ago it would have been impossible to find any product that could meet any three and possibly any two of these criteria.
The obvious initial candidates were Oracle and IBM's DB2. Without casting aspersions on any other DBMSes, and there are many good ones, these are the leading enterprise level DBMS engines in the world today ( for further discussion on measurements, capabilities, market share, and so on, please review the first paragraph of this section ) and both meet the first three criteria. Unfortunately, the downloads for these products range from 350 to nearly 500 megabytes and "easy to install, set up, and use" may not be quite the description that JDBC newcomers would apply.
Searchin', Searchin'
My first step was to go to Sun's JDBC Driver page and look for JDBC 2.0 capable products. This produced a small set ( expanded somewhat now, at the end of the course ) and very few with Xes across the board for Optional Package support. I did notice Informix and was struck that Cloudscape was not listed, since I knew that it was included with J2EE. At that point, I went to Cloudscape's site. Everything looked good for Cloudscape until I closely read the download agreement. It contained some unfortunately burdensome clauses that I did not, in good faith, feel I could ask others ( or myself ) to accept
Back to the driver page. The most promising was a product named FrontBase, which I downloaded and spent some time on. Unfortunately, it was still basically at a beta point on NT and there were some ease of use problems. Their support desk was very forthcoming and I do expect the product to be a contender in its area once the product is stabilized. But, as far as using it in the course... next! After checking out several other possibilities, both from the Driver page and professional colleagues, no other products appeared to meet the course criteria at that date.
In the end, I decided on the version of Cloudscape included with the J2EE download. While it was not the latest version available, it fit nearly all of the criteria, had obviously met some outside testing and only has Sun's download agreement to contend with. Incidentally, having possibly appeared to run down the product, I should also add that Cloudscape proved stable and impressive within the context of the course.
Searchin', Searchin' II
However, the search was still not over. While no candidate appeared that met the criteria and supported all of the JDBC 2.0 functionality, it was pretty clear that discussions and exercises for paging scrollable ResultSets and storing and retrieving BLOB data were necessary parts of the course. Cloudscape supported scrollable ResultSets, but did not support the SQL3 data types. This led to somewhat of a punt on my part: I have DB2 on my server and also, since much of my background is on the AS/400, familiarity with and access to DB2/400. With no further apologies, these would be the DBMSes for the standards-based BLOB images exercises.
This actually turned out to benefit the course, ( but not me: I had to do the work ) because I could test the programs against all three DBMS engines and have some assurance that portability requirements were being met. It is a tribute to the SQL standard, the general notion of portability in the Java programming language, the designers of JDBC and, not least, the driver implementers, that I could write a program and test it on Cloudscape, then - bang! - run it on UDB2/NT and - bang! - run it on DB2/400 over the Internet. And it ( mostly ) all worked. While there were occasional lapses in particular methods, usually allowed by the sometimes loose standards of the JDBC specification, out of 14 exercises, there were only three that did not run on all of the DBMSes and one other that required some behavior adjustment.
And, in the End
So there's bad news and good news: The bad is that after two years, there are few complete implementations of JDBC 2.0 and the Optional Package. As mentioned in the course, the JDBC 3.0 draft is under review and expected to be included in the 1.4 JDK release. We can only hope that things move a bit faster from here, and they should. The good news is that there are mostly complete implementations available today and no developer really has an excuse for not gaining experience with a production quality DBMS. And, as the author, I certainly hope that the JDBC 2.0 Fundamentals course is in some small way helpful to developers who are trying to accomplish that goal.