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 does executeupdate return in jdbc?
What is the role of class.forname while loading drivers?
How do we load the drivers?
Why do we need jdbc?
Compare jdbc and odbc and how is jdbc required in this context.
What's the benefit for specifying constraints like not null, primary key explicitly instead of specifying it against the column ?
What are the measures to connect to the db using jdbc?
How do you insert images into database using jdbc?
What is jdbc odbc bridge?
Why do we use jdbc in java?
Describe the steps needed to execute a sql query using jdbc.
How to move the cursor in scrollable resultset ?
How does JDBC API helps us in achieving loose coupling between Java Program and JDBC Drivers API?
Give a way to check that all result sets have bin accessed and update counts are generated by execute method.
What is JDBC Savepoint? How to use it?