Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is a rollback in jdbc?

998


What are jdbc?

1015


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?

973


Explain in detail about JDBC and its general features?

1000


What is hbm xml?

920


What is two-phase commit in the database?

1108


What does the jdbc databasemetadata interface?

1032


What are different types of ResultSet?

1107


How can I get or redirect the log used by DriverManager and JDBC drivers?

975


What is meant by jdbc?

963


How the JDBC application works?

1005


What is the use of dialect?

1059


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

1041


What are devices?

1026


Write an sql to find all records having all numeric characters in a field ?

1023