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 actual difference between statement,prepared
statement and callable statement and when we have to use it?
pls post a answer with code and clear explanation. thanks

Answers were Sorted based on User's Feedback



What is actual difference between statement,prepared statement and callable statement and when we h..

Answer / aravind

Statement:
When you use normal statements compilation of statement or
parsing of statement will happen everytime. This is time
cosuming when u have mutliple queries to execute.

Statemtn s = conn.createStatement();
s.executeQuery();

Prepared Statement:
In prepared statement SQL query will be compiled or parsed
for the very first time and kept in some kind of pool. When
u execute one more time the same statement with different
values it saves the parsing time.

SQL select * from employee where employeeID=?,empName=?;
PreparedStatement ps = conn.PreparedStatement();
ps.execute(1,aru);
ps.execute(2,arya);

Callable Statement:

Callable statements are used to execute stored procedures
similar to java functions.

Is This Answer Correct ?    44 Yes 5 No

What is actual difference between statement,prepared statement and callable statement and when we h..

Answer / sudha

Prepared statement is precompiled statement it is used when
we want one query to be executed n no. of times.
whereas callablestatement is used to call stored procedures

Is This Answer Correct ?    41 Yes 3 No

Post New Answer

More Core Java Interview Questions

What is data and its types?

0 Answers  


How do you check if an arraylist is not empty?

0 Answers  


can we write a program with out a class in core java?

11 Answers   Wipro,


What does the “static” keyword mean? Can you override private or static method in java?

0 Answers  


In C we use only compiler. Why java uses both compiler and interpreter? What is its significance?

5 Answers  


What is meant by binding in rmi?

0 Answers  


What modifiers may be used with an inner class that is a member of an outer class in java programming?

0 Answers  


Given a singly linked list, find the middle of the list in a single traversal without using temporary variable.

0 Answers   Fidelity,


How to call one constructor from the other constructor ?

0 Answers  


Can a class have a static inner class?

0 Answers  


Why we need Finally with try? pls expain with ur example..

3 Answers   BitWise, HDFC, TCS,


Can we have this () and super () together?

0 Answers  


Categories