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.601Medium

What is the primary advantage of using PreparedStatement over Statement?

Q.602Medium

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

Q.603Medium

What is Connection pooling in JDBC?

Q.604Medium

Which DriverManager method is used to establish a database connection?

Q.605Medium

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

Q.606Hard

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

Q.607Hard

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

Q.608Hard

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

Q.609Hard

Which JDBC feature allows you to call stored procedures?

Q.610Hard

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

Q.611Medium

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

Q.612Easy

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

Q.613Easy

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

Q.614Easy

Which interface represents a single row of data retrieved from a database in JDBC?

Q.615Medium

What does the PreparedStatement interface provide that Statement does not?

Q.616Easy

In JDBC, what is the purpose of the Class.forName() method?

Q.617Medium

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

Q.618Medium

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

Q.619Medium

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

Q.620Medium

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