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
Explain the steps in writing a java program using jdbc?
What is represented by the connection object?
How do we load the drivers?
What is difference between java.util.Date and java.sql.Date?
Why do we use jdbc in java?
Why are we using blob datatypes in jdbc?
Compare jdbc and odbc and how is jdbc required in this context.
What are the differences between setmaxrows(int) and setfetchsize(int)?
Explain about the drive manager class working?
What is JDBC Transaction Management and why do we need it?
How can we disable a constraint ?
How we store procedure in oralce for callable statements in jdbc
What is jdbc odbc in java?
How do I know which jdbc driver to use?
How many types of JDBC Drivers are present and what are they?