|
|
![]() ![]() Java Connectivity With JDBC May 3, 1999 The Native-API Partly Java Driver The Type 2 driver, also known as a native-API partly Java driver, is a variation on the JDBC-ODBC bridge. But unlike the Type 1 driver, this driver communicates natively to the target relational database. Availability and support for Type 2 drivers vary from database vendor to database vendor. Only IBM Corp. and Oracle Corp. provide such drivers for their databases. A third-party developer, WebLogic, provides Type 2 drivers for popular databases, such as Microsoft SQL, Oracle and Sybase. One advantage of this type of driver is performance; native protocol access to the database through vendor-provided libraries yields the best performance. Another benefit is support for vendor-specific relational database extensions. Just keep in mind that using such extensions deems your code non-portable and your solution will not be fully Java (it must be installed and set up on the client machines, much like the JDBC-ODBC bridge). In short, Type 2 drivers simply remove the ODBC portion of Type 1 drivers. The Net-Protocol All-Java Driver Type 3 drivers, also known as net-protocol all-Java drivers, are the most versatile and the most commonly used. Symantec Corp.'s Visual Café Database Development Edition ships with a Type 3 driver called dbAnywhere. It was one of the first middleware drivers used to connect Java programs to database sources. dbAnywhere can handle the proprietary Symantec protocol as well as JDBC to connect to other data sources. A Type 3 driver sits between the Java client and the relational database and accepts connections via normal JDBC calls. Once a call is established, the driver translates the calls to the particular database protocol and forwards them to the database. A Type 3 driver can handle multiple Java clients connecting to multiple databases. And because the driver does not have to abide by Java's sandbox security, it can connect to different IP addresses, allowing for three-tier client/server application development. The driver, or in this case middleware, runs as a daemon (or a service) on the same Web server that hosts the Java applets. The Java applets communicate with the middleware using TCP/IP, which conforms to the Java security model; Java applets can establish network connections only to the IP address where they originated. The Type 4 driver, or native-protocol all-Java driver, is similar to a Type 2 driver. It converts JDBC queries into native calls used by the particular relational database. But unlike Type 2 drivers, Type 4 drivers are written purely in Java. To accomplish its task, a Type 4 driver is very specific to the database to which it is connecting. This kind of driver should offer a performance advantage over the other types of drivers and is best suited to intranet and other projects where performance is more important than security issues. The list of available JDBC drivers changes frequently. For an up-to-date list, including type and where to obtain the driver, check out softwarema.usec. sun.com/products/jdbc/jdbc.drivers.html. The Latest on JDBC The latest release of the JDBC is version 2.0, which corresponds to the Java JDK version 1.2 release. As of this writing, JDBC 2.0 is still in beta form. Look out for one change: The JDBC API will be split into two separate APIs, the JDBC 2.0 Core API and the JDBC 2.0 Standard Extension API (javax.sql). The extension API paves the way for the development of JavaBeans, which are database-aware. This means the database component will be aware of particular rows in the database; therefore, the user can navigate the database through this "bean." Of course the real benefit is for the programmer, not the end user, as the same task can be completed using a good deal of programming. Once the appropriate beans are widely available, programmers will be able to use them to manipulate data with ease, allowing more of a focus on the business logic and less on database access. In addition, support for complex data types has been added, such as support for BLOB (Binary Large Object). Also, support for databases that can store Java objects has been added in JDBC 2.0. Another new and useful addition is support for tabular data stored outside a database (flat files). Support for external tabular data will allow programmers to easily implement models similar to .INI files. JDBC is an emerging technology that will play a major role in almost all Java-based database projects. The technology is rapidly changing and new drivers and tools are being introduced at a brisk pace. The advent of more tools will make it easier to develop for this technology, as database-aware components soon will begin to pop up all over the place. Using the database components, it will be relatively easy to design software applications that can manipulate database information with very little JDBC knowledge. However, this is not fodder for the developers. Systems administrators will need to keep an eye on the technology as the setup of drivers will be in their court--there will be network security implications with JDBC. Ahmad Abualsamid is a senior partner with 1Internet Corp. of Chicago. Send your comments on this article to him at ahmad@execpc.com. |
Page 1 | 2 | 3 | Next Page |
Print This Page E-mail this URL |














