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.21Easy

What exception is thrown when a database connection fails in JDBC?

Q.22Easy

In JDBC, what does the executeQuery() method return?

Q.23Easy

Which interface in JDBC is used to execute parameterized queries and prevent SQL injection attacks?

Q.24Easy

What is the correct sequence to establish a JDBC connection in Java?

Q.25Easy

Which method of Connection interface is used to start a transaction in JDBC?

Q.26Easy

In JDBC, what does the BatchUpdate feature allow developers to do?

Q.27Easy

Which exception is thrown when a JDBC driver is not found in the classpath?

Q.28Easy

What is the difference between commit() and rollback() in JDBC transactions?

Q.29Easy

In a JDBC application, which interface is responsible for executing SQL queries and returning ResultSet objects?