|
|
|||||||||||||||||
![]() ![]() Java Connectivity With JDBC May 3, 1999
Enter the JDBC driver, which is designed with database communication in mind. But all JDBC drivers are not created equal. So which JDBC driver should you use? Here we explain the current crop of JDBC drivers and present the issues that you can expect to encounter when developing and maintaining JDBC-based applications. Four types of JDBC drivers are available, each with its own assets and drawbacks (see " JDBC Driver Types" in PDF format), but all are relatively new and will undoubtedly undergo some revisions. Some of the explanations we present are a bit more complicated than writing the actual code and involve decisions that may be beyond programming, but the background will be beneficial for administrators and programmers alike. The JDBC-ODBC Bridge The Type 1 driver is the JDBC-ODBC bridge. Microsoft Corp.'s ODBC (Open Database Connectivity) API is the de facto standard for accessing a relational database. Short of using native access protocols--which are neither easy nor portable--ODBC is the next best thing to a standard. Given that ODBC is so widely used, the easiest way to connect JDBC to popular databases is to create bridging software between it and ODBC. Unfortunately, ODBC drivers are not written in Java. So a fair amount of native binary code--including installation and maintenance information--must reside on every client machine requiring access. Obviously, this is not an ideal solution for the Java paradigm of applets downloadable from the network. Typically, an ODBC driver is loaded as a local DLL (Dynamic Link Library), which cannot access a data store over the network. Hence, almost all JDBC-ODBC bridges are used locally for development purposes. You can use a JDBC-ODBC driver in a networked environment by employing RMI (Remote Method Invocation), which mimics a local connection to the remote database. The RMI package makes the connection to the remote machine, executes the query and brings the results to the local machine. Programmers familiar with RPCs (Remote Procedure Calls) will feel at home using RMI.
|
Page 1 | 2 | 3 | Next Page |



Here
Here
Note, however, that not all browsers support RMI. Recent versions of Netscape Communications' browser and Sun's HotJava have no problem with RMI (it's built in). But Microsoft didn't build support for RMI into its Internet Explorer (IE). Here's a little-known fact that may help: With IE versions 4.71.1712.6 and later you can download a small ZIP file from Microsoft's ftp site (ftp://ftp.microsoft.com/ developr/ msdn/ unsup-ed /rmi.zip) and uncompress it to \windows\ java\ classes (or \winnt\java\ classes for Windows NT) for RMI support in IE.









