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
Give steps to connect to the db using jdbc?
What does the jdbc connection interface?
Why is jdbc needed?
What is resultset in jdbc with example?
Why can't I invoke the ResultSet methods afterLast and beforeFirst when the method next works?
What do you understand by jdbc datasource?
What is the purpose of jdbc resultset interface?
what happen if we set JDBC string to NULL?
What are the advantages of using preparedstatement over statement?
How does a custom RowSetReader get called from a CachedRowSet?
What are the different types of resultset?
What is JDBC DataSource and what are it’s benefits?
Is jdbc secure?
Which is better odbc or jdbc?
Which type of driver is unique in jdbc?