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 the use of the statement in jdbc?

908


How can I instantiate and load a new CachedRowSet object from a non-JDBC source?

972


What does setautocommit do?

959


How can I retrieve a String or other object type without creating a new object each time?

1170


What is @entity in java?

936


password, is stored in as plain text. What can I do to protect my passwords?

954


When do we get java.sql.SQLException: No suitable driver found?

945


What is the jdbc rowset?

967


Which database is used with java?

942


Which jdbc drivers will run your program?

915


What is an odbc driver?

898


Does jpa use jdbc?

906


Is jdbc an api?

1058


How to use JDBC API to call Stored Procedures?

1005


There is a method getColumnCount in the JDBC API. Is there a similar method to find the number of rows in a result set?

1020