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 / shaik

If ur doubt is "PreparedStatement is an interface, how can
we have an object for it" , then ans is.

PreparedStatement object is the object of one of the
implementation class(that implements PreparedStatement(I))
of PreparedStatement(I).

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does jdbc driver work?

1037


What is jdbc odbc bridge?

994


What is a datasource in java?

1010


What is getconnection method in java?

982


What is the query used to display all tables names in SQL Server (Query analyzer)?

1113


What are the higher level apis under development on top of jdbc currently?

1009


How can we set null value in jdbc preparedstatement?

1007


What is the role of jdbc drivermanager class?

1121


What is represented by the connection object?

1130


Result set’s index starts with 0 or 1?

1108


Is uri the same as url?

937


What is SQL Warning? How to retrieve SQL warnings in the JDBC program?

1108


What are different parts of a url?

1051


What class.forname does, while loading the drivers?

1035


Give an example for execution of sql statement.

1084