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

Since the prepared statement is a precompiled statement and
this SQL statement is sent to the DBMS right away, where it
is compiled. As a result, the PreparedStatement object
contains not just an SQL statement, but an SQL statement
that has been precompiled. This means that when the
PreparedStatement is executed, the DBMS can just run the
PreparedStatement SQL statement without having to compile
it first.

Is This Answer Correct ?    4 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does jdbc use ssl?

880


What is the full form of jdbc and what is its purpose?

929


What are the jdbc statements?

940


Why would you use setautocommit(false) in jdbc?

1130


What are the advantages of using preparedstatement over statement?

935


What is the different between ResultSet and RowSet?

953


Write a program JDBCcode forfetching student database with SQL.

1067


Name the new features added in jdbc 4.0.

922


What is jdbc and why is it required?

880


Describe the steps needed to execute a sql query using jdbc.

917


How to insert and delete a row programmatically? (new feature in JDBC 2.0)

938


What are the main steps in java to make JDBC connectivity?

964


What are four types of JDBC driver?

1051


Is it possible to connect to multiple databases simultaneously?

994


What is phantom read and which isolation level prevents it?

992