Java programs can use the JDBC API to access relational databases, thereby
cleanly separating the database system from the application. This approach
holds the promise of cross-database portability, i.e., "write once, run on
any database." In practice, several stumbling blocks stand in the way of
fulfilling this promise.
This article shows examples of these stumbling blocks so you can see the
common pattern of development. Drawing on this pattern, I'll develop a
roadmap you can use to write applications that can work around these
stumbling blocks. Finally, I'll demonstrate how the roadmap can be applied to
build a portable application.
Breakdown of Portability
Three general situations in which the portability of code breaks down are
using SQL escape syntax, translating external data types to database-specific
types, and executing positioned updates on the rows of a ... (more)