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

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

Q.22Medium

What does the PreparedStatement interface provide that Statement does not?

Q.23Easy

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

Q.24Medium

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

Q.25Medium

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

Q.26Medium

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

Q.27Medium

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

Q.28Hard

What is the difference between update() and updateRow() methods in ResultSet?

Q.29Medium

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

Q.30Medium

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

Q.31Hard

A developer wants to prevent SQL injection attacks while executing dynamic queries. Which approach is most secure?

Q.32Hard

What is the default transaction isolation level in JDBC when autocommit is disabled?

Q.33Hard

Which method is used to check if a CallableStatement has a return value from a stored procedure?

Q.34Easy

What happens when you call rs.next() on a ResultSet after the last row?

Q.35Hard

A batch update operation fails partially. How can you identify which statements failed in the batch?

Q.36Medium

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

Q.37Hard

In JDBC, what is the purpose of using a SavePoint in a transaction?

Q.38Easy

Which interface in JDBC is used to execute a single SQL statement and return a ResultSet?

Q.39Easy

What is the primary advantage of using PreparedStatement over Statement in JDBC?

Q.40Easy

Which JDBC method is used to retrieve the number of rows affected by an INSERT, UPDATE, or DELETE statement?