Java JDBC MCQs with answers Page - 2

Here, you will find a collection of MCQ questions on Java JDBC. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

S

Satya • 3.38K Points
Extraordinary

Q. Which method is used for INSERT, UPDATE, DELETE operations?

  • (A) executeUpdate()
  • (B) executeQuery()
  • (C) executeSelect()
  • (D) executeFetch()

S

Satya • 3.38K Points
Extraordinary

Q. Which object stores data returned from a database query?

  • (A) Connection
  • (B) Statement
  • (C) ResultSet
  • (D) DriverManager

S

Satya • 3.38K Points
Extraordinary

Q. Which method moves the cursor to the next row in ResultSet?

  • (A) nextRow()
  • (B) move()
  • (C) next()
  • (D) forward()

S

Satya • 3.38K Points
Extraordinary

Q. Which method retrieves column value by column name?

  • (A) getValue()
  • (B) getString()
  • (C) getData()
  • (D) fetch()

S

Satya • 3.38K Points
Extraordinary

Q. Which exception is thrown in JDBC operations?

  • (A) IOException
  • (B) SQLException
  • (C) DatabaseException
  • (D) JDBCException

S

Satya • 3.38K Points
Extraordinary

Q. Auto-commit mode in JDBC means?

  • (A) Changes are automatically rolled back
  • (B) Each SQL statement is committed automatically
  • (C) Database disconnects automatically
  • (D) Connection closes automatically

S

Satya • 3.38K Points
Extraordinary

Q. Which method disables auto-commit?

  • (A) setCommit(false)
  • (B) setAutoCommit(false)
  • (C) disableCommit()
  • (D) commit(false)

S

Satya • 3.38K Points
Extraordinary

Q. Which method saves changes permanently?

  • (A) save()
  • (B) store()
  • (C) commit()
  • (D) apply()

S

Satya • 3.38K Points
Extraordinary

Q. Which method undoes database changes?

  • (A) rollback()
  • (B) undo()
  • (C) cancel()
  • (D) restore()

S

Satya • 3.38K Points
Extraordinary

Q. Which JDBC driver type is purely Java-based?

  • (A) Type 1
  • (B) Type 2
  • (C) Type 3
  • (D) Type 4

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ