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 sqlwarning?
any one can explain about policy file rule? when i connect database with applet then ther is no compile time error but the run time error is occureed.i.e access is denied.policy file rule is related to this problem.
What protocol does jdbc use?
What is an advantage of using the jdbc connection pool?
How can you create jdbc statements?
What is the reason why we need a jdbcrowset like the wrapper around resultset?
What are temp tables ?
How to check jdbc connection in java?
What is xe in oracle jdbc url?
What is jdbc architecture in java?
What is setautocommit in jdbc?
Why do we use jdbc in java?
What is the function of drivermanager class?
How does a custom RowSetReader get called from a CachedRowSet?
Does jdbc require oracle client?