1. Trang chủ
  2. » Doujinshi

Bài giảng Ngôn ngữ lập trình Java: Chương 6 - ĐH Giao thông Vận tải

7 18 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 7
Dung lượng 192,88 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

The Connection object is used for creating Statement, PreparedStatement, and CallableStatement objects.. * DatabaseMetaData: This interface provides detailed information about the databa[r]

Trang 1

Chương 6: LẬP TRÌNH CSDL VỚI JDBC

Khoa CNTT

ĐH GTVT TP.HCM

Khoa CNTT (ĐH GTVT TP.HCM) Java Programming 1 / 15

Trang 2

Nội dung

1 JDBC là gì?

2 Kiến trúc JDBC

3 Kết nối đến CSDL

4 Các thao tác cơ bản trên CSDL

Khoa CNTT (ĐH GTVT TP.HCM) Java Programming 2 / 15

Trang 3

JDBC là gì?

Định nghĩa

JDBC (Java Database Connectivity), which is a standard Java API for database-independent connectivity between the Java program and

a wide range of databases.

Khoa CNTT (ĐH GTVT TP.HCM) Java Programming 3 / 15

Trang 4

Kiến trúc JDBC

Khoa CNTT (ĐH GTVT TP.HCM) Java Programming 4 / 15

Trang 5

JDBC Application Program Interface (API)

Khoa CNTT (ĐH GTVT TP.HCM) Java Programming 5 / 15

Trang 6

JDBC Application Program Interface (API)

Classes & Interfaces

* DriverManager: This class loads JDBC drivers in memory It is a “factory” class and can also be used to create java.sql.Connection objects to data sources (such as Oracle, MySQL, etc.)

* Connection: This interface represents a connection with a data source The Connection object is used for creating Statement, PreparedStatement, and CallableStatement objects

* DatabaseMetaData: This interface provides detailed information about the database as a whole The Connection object is used for creating Database MetaData objects

* Statement: This interface represents a static SQL statement It can be used

to retrieve ResultSet objects

Khoa CNTT (ĐH GTVT TP.HCM) Java Programming 6 / 15

Trang 7

JDBC Application Program Interface (API)

Classes & Interfaces

* PreparedStatement: This interface extends Statement and represents a precompiled SQL statement It can be used to retrieve ResultSet objects

* CallableStatement: This interface represents a database stored procedure It can execute stored procedures in a database server

* ResultSet: This interface represents a database result set generated by using SQL’s SELECT statement Statement, PreparedStatement,

CallableStatement, and other JDBC objects can create ResultSet objects

* ResultSetMetaData: This interface provides information about the types and properties of the columns in a ResultSet object

* SQLException: This class is an exception class that provides information on

a database access error or other errors

Khoa CNTT (ĐH GTVT TP.HCM) Java Programming 7 / 15

Ngày đăng: 09/03/2021, 06:11

TỪ KHÓA LIÊN QUAN

🧩 Sản phẩm bạn có thể quan tâm