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

Which interface in JDBC is used to execute SQL queries and obtain results?

Q.2Easy

What is the correct order of JDBC operations?

Q.3Easy

Which JDBC driver type is platform-independent and does not require native code?

Q.4Easy

What exception is thrown when a database connection cannot be established?

Q.5Easy

Which method is used to retrieve a String value from a ResultSet object?

Q.6Medium

What does the executeUpdate() method return in JDBC?

Q.7Medium

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

Q.8Medium

What is the primary advantage of using PreparedStatement over Statement?

Q.9Medium

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

Q.10Medium

What is Connection pooling in JDBC?

Q.11Medium

Which DriverManager method is used to establish a database connection?

Q.12Medium

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

Q.13Hard

Consider code: String query = "SELECT * FROM users WHERE id=" + userId; stmt.executeQuery(query); What security issue exists?

Q.14Hard

How would you implement batch processing in JDBC for multiple INSERT operations?

Q.15Hard

What is the difference between execute(), executeQuery(), and executeUpdate()?

Q.16Hard

Which JDBC feature allows you to call stored procedures?

Q.17Hard

In JDBC, what does the ResultSet.TYPE_SCROLL_INSENSITIVE constant represent?

Q.18Medium

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

Q.19Easy

Which JDBC driver type is platform-independent and does not require native code installation?

Q.20Easy

What is the correct syntax to retrieve an integer value from a ResultSet object at column index 2?