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...


What is PreparedStatement?

Answers were Sorted based on User's Feedback



What is PreparedStatement?..

Answer / mathivanan

Statement:
Where we r going to a loop the SQL query has to be
compiled every iteration.

PreparedStatement:
Unlike Statement the SQL query is compiled one time and
use that pre_compiled query in all iteration. So it reduces
the execution time
While declaring the PreparedStatement itself v can give
the query which has to performed.

Is This Answer Correct ?    23 Yes 2 No

What is PreparedStatement?..

Answer / manojkumar.l

It will execute before commit sql query and also execute
multiple select statement,it will save time,faster
execution.

Is This Answer Correct ?    12 Yes 0 No

What is PreparedStatement?..

Answer / harish

Some times it is more convinient to use this for sending
SQL statements to the DBMS. The main feature , which
distinguishes it from its super class statement is that
unlike statement,it is given an SQL statement right when it
is created. This SQL statement is then sent to the DBMS
righat away,where is it compiled.

Is This Answer Correct ?    13 Yes 5 No

What is PreparedStatement?..

Answer / sowmya

prepared statement is the type of statement used to
interact with database.
To avoid syntactical complexities its the better approach
(eg:double quotes used with query strings)
we can insert many rows using single prepared statement.
eg:String str="insert into tab values("?,?,?")";
PreparedStatement stmt=con.prepareStatement(str);

Is This Answer Correct ?    7 Yes 2 No

What is PreparedStatement?..

Answer / suresh

PreparedStatements are precompiled. When you create a
PreparedStatement you supply a SQL statement. This statement
is passed right along to your database where it is compiled
and cached. The advantage of this is that if you are running
a query multiple times the database will not have to compile
it each time before it is run. This can result in a hefty
performance boost.


Read more: How to use a Java Prepared Statement | eHow.com
http://www.ehow.com/how_5386522_use-java-prepared-statement.html#ixzz12INtbKn4

Is This Answer Correct ?    0 Yes 1 No

What is PreparedStatement?..

Answer / guest

There's a popular belief that using a PreparedStatement
object is faster than using a Statement object. After all, a
prepared statement has to verify its metadata against the
database only once, while a statement has to do it every
time. So how could it be any other way? Well, the truth of
the matter is that it takes about 65 iterations of a
prepared statement before its total time for execution
catches up with a statement. This has performance
implications for your application, and exploring these
issues is what this section is all about.

When it comes to which SQL statement object performs better
under typical use, a Statement or a PreparedStatement, the
truth is that the Statement object yields the best
performance. When you consider how SQL statements are
typically used in an application--1 or 2 here, maybe 10-20
(rarely more) per transaction--you realize that a Statement
object will perform them in less time than a
PreparedStatement object. In the next two sections, we'll
look at this performance issue with respect to both the OCI
driver and the Thin driver.

Is This Answer Correct ?    0 Yes 8 No

Post New Answer

More JDBC Interview Questions

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

0 Answers  


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

0 Answers  


Explain the steps in writing a java program using jdbc?

0 Answers  


What are the different types of 2 tier and 3 tier architecture ?

2 Answers   Honeywell,


Explain how data flows from view to db and reverse

0 Answers   Bosch,


What does executeupdate return in java?

0 Answers  


i have 1000 records in resultset, how to get first 100 records from resultset, because resultset fetch all 1000 records at a time?

8 Answers   HSBC,


What is jdbc odbc in java?

0 Answers  


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

0 Answers  


How we can you use preparedstatement.

0 Answers  


How many types of statements are there in jdbc?

0 Answers  


What is two-phase commit in the database?

0 Answers  


Categories