iGET

Java Programming - MCQ Practice Questions

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

951 questions | 100% Free

Q.301Medium

Which DriverManager method is used to establish a database connection?

Q.302Medium

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

Q.303Medium

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

Q.304Medium

What does the PreparedStatement interface provide that Statement does not?

Q.305Medium

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

Q.306Medium

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

Q.307Medium

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

Q.308Medium

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

Q.309Medium

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

Q.310Medium

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

Q.311Medium

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

Q.312Medium

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

Q.313Medium

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

Q.314Medium

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

Q.315Medium

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

Q.316Medium

What happens when Connection.setAutoCommit(false) is called in JDBC?

Q.317Medium

In JDBC, what is the purpose of the ResultSetMetaData interface?

Q.318Medium

Which JDBC constant specifies read-only access for a ResultSet?

Q.319Medium

What is Connection pooling in JDBC and why is it used?

Q.320Medium

In JDBC, what is the purpose of CallableStatement?