Search Header Logo

Quizizz - Session 29 - Quản lý Transaction trong JDBC

Authored by Bình Phạm

Professional Development

Professional Development

Used 3+ times

Quizizz - Session 29 - Quản lý Transaction trong JDBC
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

PreparedStatement khác gì so với Statement trong Java?

A. PreparedStatement nhanh hơn vì tái sử dụng câu lệnh SQL

B. PreparedStatement hỗ trợ tham số hóa câu lệnh SQL

C. PreparedStatement giúp ngăn ngừa tấn công SQL Injection

D. Tất cả các đáp án trên

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Ký tự nào được sử dụng để đại diện cho tham số trong câu lệnh SQL của PreparedStatement?

A. @

B. $

C. ?

D. #

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Lệnh SQL nào được sử dụng để tạo một PreparedStatement?

A. Statement stmt = connection.createStatement(sql);

B. PreparedStatement pstmt = connection.prepareStatement(sql);

C. Statement stmt = connection.prepareStatement(sql);

D. PreparedStatement pstmt = connection.createStatement(sql);

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Lợi ích chính của PreparedStatement so với Statement là gì?

A. Hỗ trợ các tham số động

B. Cải thiện hiệu suất bằng cách tái sử dụng câu lệnh SQL đã biên dịch

C. Ngăn ngừa tấn công SQL Injection

D. Tất cả các đáp án trên

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Phương thức nào được sử dụng để gán giá trị kiểu chuỗi (String) vào tham số trong PreparedStatement?

A. setInt()

B. setString()

C. setChar()

D. setText()

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Trong PreparedStatement, chỉ số của tham số bắt đầu từ giá trị nào?

A. 0

B. 1

C. 2

D. Không có chỉ số

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Nếu một tham số trong PreparedStatement không được thiết lập giá trị, điều gì sẽ xảy ra?

A. Tham số được gán giá trị mặc định là NULL

B. Một ngoại lệ SQLException sẽ được ném ra

C. Tham số bị bỏ qua

D. Câu lệnh SQL sẽ không thực thi

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?