In this tutorial, we'll use SQLite to get to know JDBC, mainly because it's so easy to use. One of the benefits of programming in the Java ecosystem is that you will likely find a stable JDBC database connector for whatever database you choose. When you start thinking about architecture and performance, it will be beneficial to consider the type of driver you are using. Pure Java driver: A driver that implements the vendor-specific protocol directly in Java.Middleware driver: A universal interface (“middleware”) between Java and the RDBMS’s vendor-specific protocol.Native API driver: Provides an interface from Java to the native database client.JDBC-ODBC bridge driver: A thin Java layer that uses an ODBC driver under the hood.However, it is useful to be aware that there are four JDBC driver types: JDBC driversĪs an application programmer, you don’t need to immediately be concerned with the implementation of the driver you use, so long as it is secure and official. JDBC’s architecture consists of the JDBC API and JDBC drivers. Beneath that is the JDBC-compliant driver for the database you are using.įigure 2 illustrates the JDBC architecture. JDBC is the common API that your application code interacts with. The JDBC API and JDBC driver have been refined extensively over the years, resulting in a feature-rich, performant, and reliable library. The JDBC driver supports communication between the JDBC manager and the database driver.The JDBC API supports communication between the Java application and the JDBC manager.The JDBC interface consists of two layers: The difference is that JDBC is Java-specific, offering a programming-level interface that handles the mechanics of Java applications communicating with a database. In some ways, JDBC takes its inspiration from ODBC. JDBC vs ODBCīefore JDBC, developers used Open Database Connectivity (ODBC), a language-agnostic standard approach to accessing a relational database management system, or RDBMS. JDBC connects Java programs to databases. JDBC acts as a bridge from your code to the database, as shown in Figure 1. As a developer, you can use JDBC to interact with a database from within a Java program.
0 Comments
Leave a Reply. |