Home  >  Article  >  Java  >  What is jdbc and its function

What is jdbc and its function

hzc
hzcOriginal
2020-07-01 13:16:4611394browse

Java Database Connectivity, [Java Database Connectivity, JDBC for short] is an application programming interface in the Java language that is used to standardize how client programs access the database, providing methods such as querying and updating data in the database.

What is jdbc and its function

Java Database Connectivity, (JDBC for short) is an application programming interface in the Java language that is used to standardize how client programs access the database. It provides Methods such as querying and updating data in the database. JDBC is also a trademark of Sun Microsystems. What we usually call JDBC is for relational databases.

DBC drivers are divided into four types:

Type 1

JDBC-ODBC Bridge

This type of driver passes all JDBC calls to ODBC, and then let the latter call the database local driver code (that is, the database operation binary code library provided by the database manufacturer, such as oci.dll in Oracle).

Type 2

Local API driver

This type of driver accesses the database by loading the local code library (C/C, etc.) provided by the database manufacturer through the client, and The driver contains Java code.

Type 3

Network Protocol Driver

This type of driver provides a network API to the client. The JDBC driver on the client uses Socket ) to call the middleware program on the server, which converts its request into the specific API call required.

Type 4

Local protocol driver

This type of driver uses Socket to communicate directly between the client and the database.

The following is a list of ways to connect various databases using JDBC:

⒈Oracle8/8i/9i database (thin mode)

⒉DB2 database

⒊Sql Server7 .0/2000 database

⒋Sybase database

⒌Informix database

⒍MySQL database

⒎PostgreSQL database

⒏access database direct connection using ODBC

When accessing a remote database, JDBC will utilize the Internet file addressing scheme and a file name that looks very much like a web page address (Uniform Resource Locator URL).

JDBC specifies a set of object-oriented classes for programmers to use when writing SQL requests. There is an additional set of classes that describe the JDBC driver API. The most common SQL data types that can be mapped to Java data types are supported. This API provides execution support for Microsoft Transaction Server requests and the ability to commit and rollback to the beginning of the transaction.

Recommended tutorial: "java tutorial"

The above is the detailed content of What is jdbc and its function. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn