iGET

Java Programming - MCQ Practice Questions

Practice free Java Programming multiple-choice questions with detailed answers and explanations. Perfect for competitive exam preparation.

958 questions | 100% Free

Q.1Medium

What does the executeUpdate() method return in JDBC?

Q.2Medium

Which interface is used to execute precompiled SQL statements in JDBC?

Q.3Medium

What is the primary advantage of using PreparedStatement over Statement?

Q.4Medium

Which method must be called to move cursor to the next row in ResultSet?

Q.5Medium

What is Connection pooling in JDBC?

Q.6Medium

Which DriverManager method is used to establish a database connection?

Q.7Medium

What does the setAutoCommit(false) method do in JDBC?

Q.8Medium

Which of the following is the correct way to close JDBC resources to prevent resource leaks?

Q.9Medium

What does the PreparedStatement interface provide that Statement does not?

Q.10Medium

Which exception is thrown when a database operation violates a unique constraint in JDBC?

Q.11Medium

What is the correct way to use try-with-resources for JDBC operations?

Q.12Medium

Which method is used to retrieve metadata about the database in JDBC?

Q.13Medium

In JDBC, what does the ResultSet.absolute(5) method do?

Q.14Medium

Which JDBC feature allows multiple SQL statements to be sent to the database in a single round trip?

Q.15Medium

In JDBC, which concurrency type allows modifications to the ResultSet?

Q.16Medium

Which JDBC method allows you to retrieve column information such as column name, type, and size?

Q.17Medium

Which JDBC method is used to retrieve metadata information about the database?

Q.18Medium

In a JDBC batch operation, what does executeBatch() return?

Q.19Medium

What is the difference between ResultSet.TYPE_SCROLL_INSENSITIVE and ResultSet.TYPE_SCROLL_SENSITIVE?

Q.20Medium

Which JDBC method is used to set an input parameter in a PreparedStatement?