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
There is a method getColumnCount in the JDBC API. Is there a similar method to find the number of rows in a result set?
How can I write to the log used by DriverManager and JDBC drivers?
What does the jdbc resultsetmetadata interface?
Explain how data flows from view to db and reverse
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?
Does jdbc use ssl?
What is the meaning of “dirty read” in the database?
State the three different ways in which you can create a table?
Is jdbc a middleware?
How to test jdbc connection to sql server?
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.
How can you know about drivers and database information ?
What is the use of setFetchSize() and setMaxRows() methods in Statement?
What is jdbc type?
Why we use while rs next ())?