Question - What is the ResultSet interface?
Answer -
ResultSet interface is used to store the output data after the SQL query execution. The object of ResultSet maintains the cursor point at the result data. As a default, the cursor points before the first row of the result data. We can traverse the data in the resultset objects as well.
Syntax:
Statement Interface:
Statement stmnt1 = conn.createStatement();
ResultSet resultset = stmnt1.executeQuery(“Select * from EMPLOYEE”);
PreparedStatement Interface:
PreparedStatement pstmnt1 = conn.prepareStatement(insert_query);
ResultSet resultset = pstmnt1.executeQuery(“Select * from EMPLOYEE”);