Switch to standard view 
  Sybase logo
 
 
 



Introduction

During the past two years, the computing industry has seen an incredible explosion in the growth of the Internet and the World Wide Web (WWW). In this short period of time, the WWW has evolved from delivering simple static web pages to the availability of custom dynamic web pages created through various extensions to existing Web servers. Although these techniques have enabled the delivery of data from corporate data stores, they have been limited both in their performance and scalability.

During this same period of time, JavaTM has become the language of choice for developing and deploying Internet/Intranet applications. All of the leading OS and browser platforms are building Java Virtual Machines into their systems. Additionally, major development tool vendors and application suppliers are providing support for Java. Java "applets" and "servelets" are appearing all over the Web, bringing rich functionality to what was before only a static medium.

Java also offers the promise of reduced maintenance and support of application software and hardware. Companies would like to deploy Java applets that are only installed and configured on a central server. These applets would then be downloaded on demand into browsers on client machines. With this methodology, no software is pre-installed on client machines, there are minimum software maintenance and distribution costs, and the applet will execute on any vendor's hardware supporting the browser.

The next step in this evolution is the use of Java to create applets to enable mission critical business applications and transaction processing over the Internet/Intranet. This stage will require new high performance and robust methods to access the corporate data stores. One of the most promising of these methods is JDBCTM - the Java DataBase Connectivity standard. This paper explores JDBC, its various implementations, and Sybase's unique JDBC product: jConnectTM for JDBCTM.

What is JDBC?

JDBC stands for Java Database Connectivity and is the Java equivalent of ODBC. The JDBC standard was created with the help of leading database and database-tool vendors such as Sybase, Oracle, Informix, Symantec, and Intersolv. JDBC provides a programming-level interface for communicating with databases in a uniform manner similar in concept to Microsoft's Open Database Connectivity (ODBC), which has become the standard for accessing RDBMSs. The JDBC standard is based on the X/Open SQL Call Level Interface, the same basis as that of ODBC.

JDBC Implementations

Available JDBC products fall into two broad categories: those that communicate to an existing ODBC driver and those that communicate to a native database API (such as DB-Library or Client-Library for Sybase). Additionally, most JDBC products make use of a middle-tier in their architecture because of Java security restrictions and architectural limitations. Let's take a look at some of these JDBC implementations and how they compare to jConnect for JDBC.

JDBC-ODBC Bridge

The JDBC-ODBC bridge was developed by JavaSoft to take advantage of the large number of ODBC enabled data sources. As illustrated in the following diagram, Java applets (or applications if a browser is not being used) are written using the JDBC API. These JDBC calls are passed to the JDBC-ODBC bridge and converted into C language ODBC APIs. The ODBC calls are then passed to the appropriate ODBC driver for the back-end data store.

The primary advantage of using the JDBC-ODBC bridge is that because the JDBC calls are ultimately converted into OBDC calls, applications can easily access databases from multiple vendors by choosing the appropriate ODBC driver. However, this type of database connectivity does involve considerable overhead and complexity because calls must go from JDBC to the bridge to the ODBC driver and finally from ODBC to the native client API to the database.

Additionally this type of driver does not allow for just-in-time delivery of Java applets. Software must be pre-installed on any client using the JDBC-ODBC bridge. The requirement to pre-install software implies the same type of software administrative burden as for traditional client/server applications. Thus the JDBC-ODBC bridge is typically only suitable for Intranet applications where there can be control and maintenance of client machines.

Native-API partly-Java drivers

This JDBC implementation is a two-tier driver that connects the client to the database using vendor-supplied libraries (e.g. Client-Library for Sybase). These drivers are typically written in some combination of Java and C (or C++), as the driver must use a layer of C in order to make calls to the vendor libraries (which are written in C).

These drivers, like the JDBC-ODBC bridge, require that code (the vendor library) be installed on each client. Thus they have the same software maintenance problems as the JDBC-ODBC bridge.

Net-protocol all-Java driver

This type of JDBC driver translates JDBC calls into a database-independent net protocol, which is then translated into a database-specific protocol by a middle-tier server, shown in the following diagram:

This type of JDBC driver can be written entirely in Java and can provide just-in-time delivery of Java applets. However, at a minimum, an additional communication hop, along with protocol translation is required, before the translation is made to ODBC. Then there is still the overhead of going from ODBC to the native protocol before the actual database is accessed. This solution may be unacceptable for certain high performance database applications.

Native-protocol all-Java driver

This type of JDBC driver converts JDBC calls directly into the network protocol used by the specific database vendor. These drivers can be written entirely in Java and can provide for just-in-time delivery of applets. As these drivers translate JDBC directly into the native protocol, without the use of ODBC or native SQL APIs, they can provide for very high performance database access. jConnect for JDBC is this type of JDBC driver.

What is jConnect for JDBC?

jConnect for JDBC is Sybase's high performance JDBC driver. This driver is completely written in Java and is fully compliant with the JDBC standard. jConnect for JDBC communicates directly to Sybase data sources such as SQL Server or OmniCONNECT through the use of Sybase's Tabular Data Stream (TDS). TDS is Sybase's self-describing format and protocol and is the base level of communication between Sybase clients, middleware products, and data servers. Through the use of TDS, jConnect for JDBC can achieve much higher throughput than competing JDBC solutions that interface to either ODBC or native database APIs.

Additionally, jConnect for JDBC is designed for just-in-time (JIT) deployment. jConnect for JDBC is only about 200Kb in size, thus allowing for Java applets incorporating JDBC to be downloaded into a browser without any prior client software installation. From the browser, the user simply clicks on a Uniform Resource Locator (URL), and the Java applet and jConnect for JDBC are downloaded into the browser and begin execution.

Let us examine some of the ways jConnect for JDBC can be used for today's high performance Web applications.

jConnect for JDBC 2-Tier Configuration

The following diagram shows a 2-tier configuration using jConnect for JDBC. The Java applet and jConnect for JDBC are downloaded into the browser after the user "clicks" on a URL. jConnect for JDBC translates the JDBC calls directly into TDS to communicate with SQL Server (or other Sybase data source). In this configuration, the SQL Server must be on the same machine from which the applet was downloaded, as Java security requires that applets can only connect to the host from which they were downloaded.

Although jConnect for JDBC fully supports this configuration, most installations will not have the Web Server and SQL Server on the same machine. Let's look at how jConnect for JDBC can be used when the SQL Server is located on a different machine.

jConnect for JDBC 3-Tier Configuration

Having the SQL Server located on a different host than the Web Server requires some method to overcome Java security restrictions. Additionally, in many installations, there will be a firewall in front of the Web server host. Although Sybase has worked with the leading firewall vendors so that they support TDS, there are still some firewalls that only allow HTTP through.

To solve these security problems, jConnect for JDBC includes a gateway, written entirely in Java, which can be installed on the Web server host. jConnect for JDBC uses "HTTP tunneled TDS" to get through the firewall. (HTTP Tunneled TDS simply means that the TDS protocol has been "tunneled" inside of HTTP.) The gateway decodes the HTTP tunneled TDS and forwards the TDS protocol to the Sybase data source. This process is reversed in the return direction.

jConnect for JDBC 3-Tier Server Side Configuration

jConnect for JDBC can also be used in Web applications where the business logic is divided between applets and servelets. These applets and servelets typically communicate using either ActiveX (DCOM) or CORBA (IIOP) protocols. In this type of configuration, jConnect for JDBC can provide high performance JDBC connectivity to Sybase data stores without the overhead of ODBC or native APIs.

jConnect for JDBC Performance

From the initial design to the completed product, jConnect for JDBC has had performance as its primary goal. Without the use of ODBC or native SQL APIs, jConnect for JDBC communicates directly to Sybase data sources in the most efficient manner by using TDS as seen in the following diagram:

Performance testing is always a difficult task, and with JDBC products it is more so because of the interplay between Java VMs, browsers, applications or applets, and hardware platforms. When comparing performance of JDBC products, it is always necessary to explain what platform, what VM, and what functionality are being compared. The following table gives a comparison of jConnect for JDBC against a competing 3-Tier JDBC product.

Note: These tests were run on a 66Mhz Pentium processor running NT4.0 using Netscape 3.01. Except where noted all functions return 10,000 rows of 1 column of the data-type. Time in seconds. As can be seen by these tests, jConnect for JDBC provides truly high performance database access.

 

jCo nnect for JDBC Access to Heterogeneous Data Sources

jConnect for JDBC can also be used to access a wide variety of heterogeneous data sources. By using Sybase's OmniCONNECT product, jConnect for JDBC can provide high performance transparent connectivity to over 25 different enterprise and legacy databases from Java applications or applets. In addition, jConnect for JDBC can also access Oracle, AS/400, and other data sources directly using Sybase's DirectCONNECT product.

Conclusion

jConnect for JDBC was designed with today's high performance Internet and Intranet applications in mind. It is written entirely in Java and can be used to deploy applications with no client software installation. Additionally, jConnect for JDBC is JDBC standards compliant and provides native access to Sybase data sources. Download jConnect for JDBC at the Sybase Home Page: www.sybase.com.

jConnect is a registered Trademark of Sybase, Inc. JDBC and Java are registered Trademarks of JavaSoft.



Back to Top
© Copyright 2010, Sybase Inc.