Hi my doubt is that preparedStatement is a interface means
which has no implemenation.plz go thru the code below
String sql = "SELECT * FROM movies WHERE year_made = ?";
prest = con.prepareStatement(sql);
prest.setInt(1,2002);
ResultSet rs1 = prest.executeQuery();

Now setInt and executeQuery how it works since it is
interface it does not have implementation how it works, how
executeQuery returns result from database as executequery
method has no implementation even in Statement interface.

Answer Posted / arin

just return the resultset rs.Its sufficient.

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is encrypted connection?

496


Where is jdbc url mysql?

494


What is a jdbc connection pool?

504


Which package is used for jdbc application?

508


How to invoke Oracle Stored Procedure with Database Objects as IN/OUT?

577






What is the feature of jdbc v4?

481


Differentiate between a statement and a preparedstatement.

491


What are the different classes through which JDBC represents statements?

503


What is the difference between ojdbc6 and ojdbc7?

465


What does it mean to "materialize" data?

518


What are the steps to connect to the database in java?

516


What are the considerations for deciding on transaction boundaries?

554


What are the differences between setmaxrows(int) and setfetchsize(int)?

536


What is jdbc and its advantages?

492


What is the return type of class.forname() method?

541