JDBC Learning Note (1): JDBC Theory overview

Source: Internet
Author: User

Brief introduction
    • JDBC (Java Data Base Connectivity,java database connection), an API consisting of some interfaces and classes. Enables programmers to connect to the database through this API interface and use Structured Query language (i.e. SQL) to complete the lookup and update of the database. (SQL is often pronounced as "sequel", which is the industry standard for database access.) JDBC is one of the most commonly used class libraries in Java.
    • Part of the J2SE is made up of java.sql,javax.sql packages.
    • The relationship between the application, the JDBC API, the database driver, and the database. 1:
JDBC Driver type
  • First: The driver translates jdbc into ODBC, and then uses an ODBC driver to communicate with the database. [Odbc/jdbc Bridge]
  • Class II: consists of a subset of Java programs and some local code that communicates with the client API of the database. Before using this driver, the client needs not only to install the Java class Library, but also to install some platform-related code.
  • Class III: The driver is a pure Java Client class library. Sends a database request to a server artifact in a protocol that is not related to a specific database, and then translates the database request into a database-dependent protocol.
  • class Fourth: the driver is a pure Java class library that translates JDBC requests directly into database-related protocols.

In summary, JDBC ultimately achieves the following goals:

  • by using standard SQL statements , even standard SQL extensions, programmers can use the Java language to develop applications that access the database while still adhering to the relevant Java language conventions.
  • database vendors and data The library developer can provide the underlying driver. Therefore, you can optimize the drivers for the respective database products.

In the traditional C/s mode, the database is typically deployed on the server side, while the client installs a rich GUI interface. In this model, the JDBC driver should be deployed on the client.

Traditional client/server applications

Today, the world is moving from the C/S mode to "three-tier Application Mode", or even more advanced "N-tier Application Mode". In the three-tier application mode, the client does not call the database directly, but instead calls the middleware layer on the server, and finally the middleware layer completes the query operation of the database. This three-tier application model has some advantages:

Communication between the client and the middle tier can be done through HTTP (when the Web browser is used as a client), or through mechanisms such as the remote method invocation rmi. JDBC is responsible for communicating between the middle tier and the back-end database. The basic architecture of this communication model is as follows:

Application of three-layer structure

JDBC Learning Note (1): JDBC Theory overview

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.