Java JDBC MCQs with answers Page - 4

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 type of ResultSet allows scrolling forward and backward?

  • (A) TYPE_FORWARD_ONLY
  • (B) TYPE_SCROLL_INSENSITIVE
  • (C) TYPE_STATIC
  • (D) TYPE_SIMPLE

S

Satya • 3.38K Points
Extraordinary

Q. Which method moves cursor to the first row?

  • (A) first()
  • (B) start()
  • (C) top()
  • (D) begin()

S

Satya • 3.38K Points
Extraordinary

Q. Which method checks if ResultSet has next row?

  • (A) hasNext()
  • (B) next()
  • (C) checkNext()
  • (D) available()

S

Satya • 3.38K Points
Extraordinary

Q. Which interface is used for connection pooling?

  • (A) DataSource
  • (B) DriverManager
  • (C) ConnectionPool
  • (D) PoolManager

S

Satya • 3.38K Points
Extraordinary

Q. Connection pooling improves?

  • (A) Memory usage
  • (B) Application performance
  • (C) UI design
  • (D) Compilation speed

S

Satya • 3.38K Points
Extraordinary

Q. Which method retrieves integer value from ResultSet?

  • (A) getInteger()
  • (B) getInt()
  • (C) readInt()
  • (D) fetchInt()

S

Satya • 3.38K Points
Extraordinary

Q. Which method retrieves date value from ResultSet?

  • (A) getDate()
  • (B) getDay()
  • (C) fetchDate()
  • (D) readDate()

S

Satya • 3.38K Points
Extraordinary

Q. Which JDBC URL is correct for MySQL connection?

  • (A) jdbc:mysql://localhost:3306/dbname
  • (B) jdbc://mysql/dbname
  • (C) mysql:jdbc://localhost/dbname
  • (D) jdbc:database:mysql/dbname

S

Satya • 3.38K Points
Extraordinary

Q. Which driver is commonly used for MySQL JDBC?

  • (A) oracle.jdbc.driver
  • (B) com.mysql.cj.jdbc.Driver
  • (C) mysql.jdbc.connect
  • (D) org.mysql.driver

S

Satya • 3.38K Points
Extraordinary

Q. Which method prepares SQL statement before execution?

  • (A) prepareQuery()
  • (B) prepareStatement()
  • (C) createPrepared()
  • (D) buildStatement()

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