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
What is encrypted connection?
Where is jdbc url mysql?
What is a jdbc connection pool?
Which package is used for jdbc application?
How to invoke Oracle Stored Procedure with Database Objects as IN/OUT?
What is the feature of jdbc v4?
Differentiate between a statement and a preparedstatement.
What are the different classes through which JDBC represents statements?
What is the difference between ojdbc6 and ojdbc7?
What does it mean to "materialize" data?
What are the steps to connect to the database in java?
What are the considerations for deciding on transaction boundaries?
What are the differences between setmaxrows(int) and setfetchsize(int)?
What is jdbc and its advantages?
What is the return type of class.forname() method?