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

There is a method getColumnCount in the JDBC API. Is there a similar method to find the number of rows in a result set?

696


How can I write to the log used by DriverManager and JDBC drivers?

610


What does the jdbc resultsetmetadata interface?

628


Explain how data flows from view to db and reverse

1724


Which of the attributes in the monitoring tab for a jdbc connection pool in the administrative console tell us how many clients are currently waiting for a connection?

601






Does jdbc use ssl?

582


What is the meaning of “dirty read” in the database?

641


State the three different ways in which you can create a table?

599


Is jdbc a middleware?

587


How to test jdbc connection to sql server?

582


Can I set up a connection pool with multiple user IDs? The single ID we are forced to use causes problems when debugging the DBMS.

606


How can you know about drivers and database information ?

629


What is the use of setFetchSize() and setMaxRows() methods in Statement?

605


What is jdbc type?

585


Why we use while rs next ())?

606