FairCom JDBC overview

Developer Guide
FairCom JDBC Developer's Guide
Audience: Developers
Subject: Java Database Connectivity through an industry-standard JDBC driver
Copyright: © Copyright 2025, FairCom Corporation. All rights reserved. For full information, see the FairCom Copyright Notice.

FairCom DB SQL JDBC provides access to FairCom DB SQL environments from applications supporting JDBC 4.0 API and requires JRE/JDK 1.6 or later.

In V12 and later, JDBC conformance level 4.3 provides Java 9 and later compatibility.

JDBC allows applications to connect to any database using the same set of Java interfaces. Those interfaces allow programs to embed standard Structured Query Language (SQL) statements that update and retrieve data in the database.

As Java interfaces and SQL syntax are independent of any particular database implementation, JDBC makes it feasible for applications to connect to different database environments without modification.

Architecture

JDBC insulates Java applications from variations in database access implementations through the JDBC API, a set of class libraries distributed as a standard part of core Java. Instead of using calls to vendor-specific interfaces, JDBC applications use the JDBC API.

The JDBC API is distributed as the package java.sql and is included with the Java JDK (Version 1.6 or later), so any environment that supports a recent Java compiler can be used to develop JDBC applications.

Calls to the JDBC API are managed by the JDBC driver manager. The JDBC driver manager can support multiple drivers connecting to different databases. When an application tries to connect to a particular database, the driver manager loads the appropriate JDBC driver and routes subsequent calls through the driver.

A JDBC driver is a database-specific software that receives calls from the JDBC driver manager, translates them into a form that the database can process, and returns data to the application.

The following figure shows the different components of the JDBC architecture.

In This Chapter
Types of JDBC Drivers
JDBC Compared to ODBC
JDBC versioning

Types of JDBC Drivers

JDBC drivers can either be entirely written in Java so that they can be downloaded as part of an applet, or they can be implemented using native methods to bridge to existing database access libraries.

The Oracle JDK (previously known as "JavaSoft JDK™") defines four different types of JDBC drivers, as noted in the previous figure and outlined in the following sections.

The FairCom DB SQL JDBC Driver is a Type 4 driver.

In This Section
JDBC-ODBC Bridge Drivers
Native-Method Drivers
Network-Protocol All-Java Drivers
Native-Protocol All-Java Drivers (c-treeSQL JDBC Driver)

JDBC-ODBC Bridge Drivers

Type 1 drivers translate calls to JDBC methods into calls to Microsoft Open Database Connectivity (ODBC) functions. Bridge drivers allow JDBC applications immediate access to database connectivity provided by the existing array of ODBC drivers.

Both the Oracle JDK (previously known as the "JavaSoft JDK™") and Microsoft Java SDK include JDBC-ODBC bridge drivers.

ODBC architecture requires that the ODBC driver manager and (typically) the ODBC drivers themselves be loaded on each client system. The requirement for software resident on client systems means that JDBC-ODBC bridge drivers will not work with Java applets run from an Internet browser. Browsers do not allow applets to run another program on the client to which they are downloaded. (In general, JDBC-ODBC bridge drivers will not work in environments that restrict Java applications from reading and writing files or running other programs.)

JDBC-ODBC bridge drivers are still useful in corporate networks, or for use by application server code written in Java in a 3-tier architecture. In such an environment, the application server has intermediary software, such as Blue Lobster’s Aptivity, that receives requests from browsers and other Internet applications. The intermediary software in turn calls the JDBC driver manager when it receives a database request.

Native-Method Drivers

Type 2 drivers contain Java code that calls “native” C or C++ methods already implemented by database vendors.

Like an ODBC driver, a native-method driver must be installed on each client or server that uses it, and thus has the same limitations as the JDBC-ODBC bridge drivers. A typical use of native-method drivers is on application servers.

Network-Protocol All-Java Drivers

Type 3 drivers are completely written in Java. They translate JDBC calls into a database-independent network protocol which is in turn translated to a DBMS protocol by middleware on a network server.

This type of driver can thus connect many Java clients to many different databases. The specific protocol used depends on the vendor.

Type 3 drivers are the most flexible since they do not require any driver software resident on client systems and can allow a single driver to provide access to multiple databases.

Native-Protocol All-Java Drivers (c-treeSQL JDBC Driver)

Type 4 drivers are also written completely in Java, but do not rely on middleware. They convert JDBC calls directly into the network protocol used by a particular database. This approach allows a direct call from the client system to the database server. Also, since there is no client-resident software, it also is practical for Internet applications.

Type 4 drivers provide the best performance.

The FairCom DB SQL JDBC Driver is a Type 4 driver.

JDBC Compared to ODBC

Generally speaking, JDBC is to Java what Microsoft’s Open Database Connectivity (ODBC) interface is to the C language. Both JDBC and ODBC:

  • Provide a vendor-independent API that allows the same application to connect to different vendors’ databases and retrieve and update data using standard SQL statements.
  • Adopt the architecture of imposing a driver manager between applications and vendor-supplied drivers that translate between the standard API and a vendor’s proprietary implementation.
  • Are based on the X/Open SQL call-level interface specification.

JDBC proponents cite these advantages of JDBC over ODBC:

  • JDBC applications enjoy the platform-independence of Java, which lends itself to Internet applications. ODBC applications must, at a minimum, be recompiled to run on a different operating-system/hardware combination.
  • JDBC does not require software on each client system, which lends itself well for Internet applications.
  • JDBC is simpler and easier to learn than ODBC.
  • JDBC is not primarily targeted for desktop application development, which makes for faster implementation outside the Windows environment and is frequently used in enterprise class applications.

JDBC versioning

Standard FairCom packages provide the following versions of the JDBC driver:

  • ctreeJDBC.jar
  • ctreeJDBC_1_7.jar
  • ctreeJDBC_1_8.jar
  • ctreeJDBC_1_9.jar
  • ctreeJDBC_1_11.jar
  • ctreeJDBC_1_17.jar

Select the driver that best suits your requirements based on the specifications below. You can then rename your version of the JDBC driver to ctreeJDBC.jar to ease the loading of the driver into your Java applications.

ctreeJDBC.jar/ctreeJDBC_1_8.jar are Driver compliant with the JDBC 4.1 specification and are used as the default version for tutorials and samples. Requires Java 8 (1.8) or newer to run.

ctreeJDBC_1_7.jar is a Legacy driver distributed for compatibility reasons. Because of this, we do not suggest using this version unless you are unable to upgrade to a newer version of Java. it is compliant with the JDBC 4.1 specification and requires Java 7 (1.7) or newer to work.

ctreeJDBC_1_9.jar is Driver compliant with the JDBC 4.2 specification and requires Java 9 or newer to run.

ctreeJDBC_1_11.jar is Driver compliant with the JDBC 4.3 specification and provides a socket keep-aline feature not present in the other variations of the drive. Requires Java 11 or newer to run.

ctreeJDBC_1_17.jar has he same features as ctreeJDBC_1_11.jar but is built with Java 17 to take advantage of the latest language optimizations. Because of this, it requrires Java 17 or newer to run.