hazarath


{ City } bangalore
< Country > india
* Profession * asst.systems engineer
User No # 7734
Total Questions Posted # 0
Total Answers Posted # 3

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 22
Users Marked my Answers as Wrong # 3
Questions / { hazarath }
Questions Answers Category Views Company eMail




Answers / { hazarath }

Question { 5211 }

What are stored procedures? How to call them?


Answer

Stored Procedure is a set of precompiled SQL statements
(i.e., ready for execution), which will be executed at
Database server(backend).
By using the Callable Statement,We can call the Stored
Procedure from front-end.Callable is an interface.Every
vendor can provide their own implementation classes for
this intercace.By using this Callable Statement, we can
call the Stored Procedure/Stored Function.

Ex/Syntax:
Connection con=DriverManager.getConnection("---
","UID","PWD");
CallableStatement cstmt=con.prepareCall('{call
ProcedureName}');

Is This Answer Correct ?    2 Yes 0 No

Question { Symphony, 18848 }

What is the use of Application Object and Session Object in
JSP?


Answer

When a Java bean object is used in while processing
multiple requests and the information is specific to the
particular client, then we place that Java been object in
Session.

When a Java bean object is used in while processing
multiple requests and the information is not specific to
the any client, then we place that Java been object in
Application.

Is This Answer Correct ?    16 Yes 3 No


Question { Fidelity, 15725 }

callable is interface or class ?


Answer

Yes Callable is an interface. Actually 3 ineterfaces are
provided in java for retreiving the data from DB.Those are:
1.Statement
2.PreparedStatement
3.Callable Statement

Every vendor provide their own implementations for these
interfaces.

If we use Statement object, then the SQL query is parsed
and executed each and every time when the request comes.
If the SQL statement is same but with different values <--
in this scenario no need of parsing each time,only
execution is needed, because same statement is sending to
the server several times but with different values.In this
scenario it is better to parse the statement for first time
only, later onwards it is better to send only values. So in
this situations, it is better to go for
PreparedStatement.It increases the speed also.

If you are planing to call the stored procedures from front
end, then it is better to use Callable statement.

EX(syntax):

Connection con=DriverManager.getConnection("----
","userID","pwd"):
CallableStatement cstmt=con.prepareCall('{call
procedureName}');

Is This Answer Correct ?    4 Yes 0 No