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

Explain the steps in writing a java program using jdbc?

942


What is represented by the connection object?

1082


How do we load the drivers?

999


What is difference between java.util.Date and java.sql.Date?

1127


Why do we use jdbc in java?

1055


Why are we using blob datatypes in jdbc?

1088


Compare jdbc and odbc and how is jdbc required in this context.

938


What are the differences between setmaxrows(int) and setfetchsize(int)?

1065


Explain about the drive manager class working?

1115


What is JDBC Transaction Management and why do we need it?

1155


How can we disable a constraint ?

1026


How we store procedure in oralce for callable statements in jdbc

2335


What is jdbc odbc in java?

1090


How do I know which jdbc driver to use?

1009


How many types of JDBC Drivers are present and what are they?

1192