12.4 Summary


This chapter has reviewed JDBC, another API for persisting data in Java, specifically tailored to wide-spread relational databases. A brief overview of relational databases, a history of JDBC, an introduction to the new JDBC 3.0 API, and a source code case study showing the practical use of JDBC were presented in the beginning of the chapter.

The second part of this chapter then compared JDBC with JDO, discussed features and differences of each, and highlighted common misconceptions. The general conclusion drawn was that they are complementary APIs, each serving their own purpose well, and examples of applicability of each API were discussed.

On performance, it was shown that a JDO-based application need not be slower than JDBC-based ones, and in many cases they can actually be faster because unnecessary yet costly remote roundtrips to the datastore could be avoided.

On JDBC 3.0 innovations, the most interesting point from a JDO perspective may be the new support for mapping SQL-99 user -defined types (UDTs) to classes in the Java programming language. The future will tell whether relational database vendors will consistently implement this in their products and JDBC drivers, and whether JDO implementations are actually able to leverage this new JDBC 3.0 feature and transparently map persistent JDO-enhanced classes to SQL-99 UDTs, instead of having to implement the SQLData interface and writing to SQLOutput and SQLInput streams manually, as would be required with a pure JDBC 3.0 application.

Last but not least, we think that after you have read this book, the cases in which you want to use only JDBC, with no JDO, for a new usual general-purpose application, will be rare ones. Only special "processing" like applications for bulk loading, data transformation, and so on come to mind as possibly not suitable for JDO at all.



Core Java Data Objects
Core Java Data Objects
ISBN: 0131407317
EAN: 2147483647
Year: 2003
Pages: 146

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net