Lesson: JDBC Introduction
官网地址
我的码云
JDBC manage three programming activities:
- Connect to a data source, like a database.
- Send queries and update statements to the database.
- Retrieve and process the results received from the database in answer to your query.
JDBC Product Components
JDBC includes four components:
- The JDBC API is divided into two packages: java.sql and javax.sql.
- JDBC Driver Manager
- JDBC Test Suite
- JDBC-ODBC Bridge
主要使用前两个, 测试后面学习 junit5 的时候留意一下
JDBC Architecture
Two-tier and Three-tier Processing Models
In the two-tier model, a java application talks directly to the data source.
In the three-tier model, commands are sent to a “middle tier” of services.
A Relational Database Overview
In simplest terms, a relational database is one that presents information in tables with rows and columns.
Integrity Rules
- duplicate rows are not allowed
- column values must not be repeating groups or arrays.
- a null value is missing.
- primary key cannot be null.
Common SQL Commands
DML data manipulation language
- select
- insert
- delete
- update
DDL data definition language - create table
- drop table
- alter table