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

ArticlesWhat Do Java Developers Want?


May 1998 / Reseller / JDBC's Growing Pains / What Do Java Developers Want?

Java developers aren't shy about pointing out JDBC's shortcomings. Here are some wishes on the top of their fix-it list.

1. Write Better Documentation. Consultant Jennifer McLean of Clarkston-Potomac gives high marks to the JavaSoft support staff for helping solve technical problems. But, she says, JDBC is plagued by Spartan tech manuals that could otherwise help developers avoid time-consuming tech-support calls.

2. Specify Techniques for Ma pping Data Types into Java. According to Ward Mullins of Thought, Inc., the JDBC spec fails in not specifying how common databases and database types map to specific Java types. "Instead of saying 'For Oracle, a DATE type should map to a Java Timestamp object,' the JDBC spec leaves it up to JDBC driver vendors to decide if they even support specific types and how those types map into Java," Mullins says. The result: An ap plication written for one driver vendor may get a different result-field object if you run it against the same tables using drivers from another vendor. "Because the spec is loose, so are the implementations," Mullins complains.

3. Control the Use of "Undefined" Fields. JDBC driver vendors may choose not to support a given database type and describe it as an "undefined" field when one or more of the JDBC types could readily be used to map the value into JDBC. "This is often done because it makes passing the JDBC driver compatibility tests easie r," Mullins says. "Those tests allow database types to be listed as 'undefined', and doing so will skip any logic that might test their compatibility."

4. Standardize Metadata Management. To create a JDBC command as one line of code that works under a variety of JDBC drivers requires custom coding for developers to achieve consistent results.

Mullins offers a hypothetical example: To find all the columns for a given table, a call passes through the fields "catalog" (the database catalog name), "schemaPattern" (the user ID in Oracle and other DBMSes), "tablePattern" (a table or wildcard pattern used for tables), and "columnNamePattern" (the column name or wildcard).

"The values I enter for these for fields will vary wildly among JDBC drivers," Mullins says. "Some want the catalog parameter to be an empty string. Others want it to be a 'null' value. Others want it to be a wildcard (usually a % character as a Java string). Likewise the schema, table, and column patterns can vary in the same w ay."

Mullins says there are also problems with the return values of getColumns in many drivers. "Some throw in Java exceptions when you try to extract the results, which must be caught correctly or your whole program blows up," he says. "Others return faulty data, such as invalid column data-type information, while others simply don't return certain information that should be readily available."

5. Handle Transactions Consistently. Some JDBC drivers allow only one result set, rather than multiple results, open at once. With other drivers, there's a lack of reverse scrollability (i.e., an application can move either forward or backward from the current row).

Finally, some drivers display exceptions if you read the same column twice, and most don't fully support the JDBC matrix of casting. "The casting chart means, for example, I should be able to read an integer value from the database into a Java LONG," Mullins says.


Up to the Reseller section contentsGo to previous article: JDBC Driver QuartetGo to next article: The Road to a Universal Repository
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