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

Once I have the Java 2 SDK, Standard Edition, from Sun, what else do I need to connect to a database?

999


What is jdbc odbc bridge?

951


What is com mysql jdbc driver?

924


Which type of driver is unique in jdbc?

987


What do you understand by DDL and DML statements?

921


Why can't Tomcat find my Oracle JDBC drivers in classes111.zip?

977


Why would you use setautocommit(false) in jdbc?

1205


How many packages are available in jdbc api?

961


Why we use while rs next ())?

965


Can resultset be null in java?

928


What do you understand by jdbc driver and explain its types?

944


What is an advantage of using the jdbc connection pool?

878


What is savepoint in jdbc?

913


Name the method, which is used to prepare a callablestatement.

910


Name the new features added in jdbc 4.0.

981