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

What causes no suitable driver error?

921


How do I set properties for a JDBC driver and where are the properties stored?

900


What are the different types of interfaces in the api component?

914


What are different types of JDBC Drivers?

1042


How many categories of jdbc drivers are there?

851


Is it possible to connect to multiple databases simultaneously? Using single statement can one update or extract data from multiple databases?

960


What are different parts of a url?

895


What is a jdbc url?

832


How do you insert images into database using jdbc?

1015


What are the common tasks of JDBC?

933


What is the role of class.forname while loading drivers?

939


What is a statement in java?

851


What is jdbc and why is it required?

879


State the three different ways in which you can create a table?

907


How can you retrieve data from the resultset using jdbc?

990