Write Once, Run Anywhere

Java is architecture-neutral, portable, and robust in that it can run on various platforms and anywhere on a network, regardless of which graphic subsystem is in use. Java is independent of hardware, operating systems, and graphical user interfaces (GUIs). The design of the Java Virtual Machine (JVM), as well as all the standard and enterprise APIs, makes Java portable — much more portable than C or C++ — which greatly simplifies deployment issues. This is why Java has such presence in the industry. Although there are still a number of issues when porting application code from platform to platform, those issues are minor when compared to the problems of porting C++ code from UNIX to the Macintosh OS, for example, not only for multithreading, networking, or UI aspects, but also when proprietary database APIs come in the picture. JDBC tries to preserve development efforts by abstracting almost all aspects of interfacing programs with relational databases. As a result, it won’t be that hard for a programmer to switch from, say, Oracle to Sybase, or vice versa, or from mSQL to DB2. Java 2 Enterprise Edition and the Enterprise JavaBeans actually benefit from database independence a lot, as a good part of this framework heavily relies on database access.

As discussed in the following sections, there are various places where JDBC can be leveraged to integrate databases. This can be on the client side or on any server tier or integration tier — and even on smartcards and Palmtops because lightweight databases are now available on those platforms, too. JDBC is an interface specification designed to be platform independent and is truly portable. Depending on what is done at the application side and how it is done, the whole may be fully or partially portable. You won’t be necessarily constrained to use the very basic features of relational databases to build portable applications. Indeed, JDBC’s coverage is broad enough to provide naming, connection, querying, transaction management, type mapping, database metadata, cursors, and several other facilities in a totally database-independent manner. It is up to database vendors and third parties to implement fully compliant drivers for specific databases.

However, you shouldn’t underestimate several aspects of integrating with databases. As a developer, you cannot always control all the environmental conditions in which the applications will have to run and behave properly. Here are some of these aspects:

  • The JDBC driver’s compliance to the standard API

  • The JDBC driver’s type, which may be fully Java or may use native libraries

  • Whether the JDBC driver is multithread-safe

  • The JDBC driver’s capability to tunnel networking protocols through HTTP

  • The JDBC driver’s naming scheme for databases

  • The JDBC driver’s and database’s limitations for data types and maximum type sizes

  • The database locking strategy (row versus page)



JDBC 3. 0. JAVA Database Connectivity
JDBC 3: Java Database Connectivity
ISBN: 0764548751
EAN: 2147483647
Year: 2002
Pages: 148

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