ExamVeda
Login
Home
21
What is the purpose of the JDBC `Batch` processing feature?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
22
Which SQL statement is used to insert data into a database table in JDBC?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
23
In JDBC, what is the primary purpose of the `Driver` interface?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
24
Which of the following is NOT a valid method to execute an SQL query in JDBC?
Discuss
Answer & Solution
Answer: Option C
Solution:
executeUpdate(): This method is used to execute SQL statements that update the database, such as INSERT, UPDATE, or DELETE statements. It returns an integer representing the number of rows affected by the query.

execute(): This method can be used to execute any SQL statement, and it returns a boolean. The returned value is true if the result is a ResultSet object; otherwise, it returns false.

executeBatch(): This method is used to execute a batch of SQL statements. It sends multiple SQL statements to the database for execution as a batch and returns an array of update counts. It is not used to execute a single SQL query.

executeQuery(): This method is used to execute SQL queries that retrieve data from the database, such as SELECT statements. It returns a ResultSet object containing the data produced by the query.

Therefore, executeBatch() is not a valid method to execute a single SQL query in JDBC.
25
In JDBC, what is the purpose of the `java.sql.SQLException` class?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
26
What is the primary role of the JDBC `ConnectionPoolDataSource` interface?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
27
Which of the following is a valid way to handle exceptions in JDBC?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
28
What is the primary purpose of the JDBC `RowSet` interface?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
29
In JDBC, what is the purpose of the `java.sql.SQLWarning` class?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
30
Which of the following is a valid method to retrieve data from a JDBC `ResultSet`?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board