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 / kaviarasan
Good Question .
Berofe Writing the prepared statement ...
every one of us ill load the driver by using
Class.forName("Some driver which has the Driver class")
Here the this Driver Class/object triggers out the other
classes in which that class implements the neccessary
interface for the operation ....
preparedStatement ps=connection.getPreparedstatement();
this function ill returns the object from the Driver
instancianted class
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is a rollback in jdbc?
What are jdbc?
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?
Explain in detail about JDBC and its general features?
What is hbm xml?
What is two-phase commit in the database?
What does the jdbc databasemetadata interface?
What are different types of ResultSet?
How can I get or redirect the log used by DriverManager and JDBC drivers?
What is meant by jdbc?
How the JDBC application works?
What is the use of dialect?
What is the use of setFetchSize() and setMaxRows() methods in Statement?
What are devices?
Write an sql to find all records having all numeric characters in a field ?