What is JDBC?
What is JDBC?
Java Database Connectivity (JDBC) is an application programming interface (API) for the Java programming language that defines how a client may access a database. It provides methods for querying and updating data in a database, and is oriented toward relational databases. JDBC is part of the Java Standard Edition platform from Oracle Corporation[5].
JDBC allows Java applications to interact with any SQL-compliant database by using a set of standard interfaces. The API provides functionality for connecting to a database, executing SQL statements, and retrieving results. These operations are carried out through what JDBC terms as "connections," "statements," and "result sets."[2][4].
The core component of JDBC is the JDBC API, which includes two packages: java.sql
and javax.sql
. These packages contain classes and interfaces that Java applications use to interact with databases. The java.sql
package includes interfaces like Connection
, Statement
, PreparedStatement
, ResultSet
, and others that handle the connection to the database and the execution of SQL statements. The javax.sql
package extends the functionality of java.sql
to include features such as connection pooling and distributed transactions[2][4][16].
JDBC drivers are crucial for connecting to a database. These drivers are categorized into four types:
junior
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào