callable is interface or class ?

Answers were Sorted based on User's Feedback



callable is interface or class ?..

Answer / mrangababu

callable is an interface . purpose is to call procedures.

Is This Answer Correct ?    10 Yes 1 No

callable is interface or class ?..

Answer / pratik

interface

Is This Answer Correct ?    8 Yes 1 No

callable is interface or class ?..

Answer / anjani kumar jha

always remember,there r three types of statement interface
in java
1)statement
2)prepared statement
3)callable statement

Is This Answer Correct ?    7 Yes 1 No

callable is interface or class ?..

Answer / hazarath k

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

callable is interface or class ?..

Answer / kuldeep raaj sharma

The Statement is an interface and its subclasses are
PreparedStatement and CallableStatement.

The Statement interface defines methods for executing SQL
statements that do not contain parameter markers. The
PreparedStatement interface adds methods for setting input
parameters, and the CallableStatement interface adds
methods for retrieving output parameter values returned
from stored procedures.

The CallableStatement interface extends PreparedStatement
with methods for executing and retrieving results from
stored procedures.

Creating a CallableStatement Object
As with Statement and PreparedStatement objects,
CallableStatement objects are created by Connection
objects. CODE EXAMPLE 13-18 shows the creation of a
CallableStatement object for calling the stored
procedure ‘validate’, which has a return parameter and two
other parameters.

CallableStatement cstmt = conn.prepareCall(
“{? = call validate(?, ?)}”);

Setting Parameters
CallableStatement objects may take three types of
parameters: IN, OUT, and
INOUT. The parameter can be specified as either an ordinal
parameter or a named
parameter. A value must be set for each parameter marker in
the statement.
The number, type, and attributes of parameters to a stored
procedure can be
determined using the DatabaseMetaData method
getProcedureColumns.
Parameter ordinals, which are integers passed to the
approriate setter method, refer to the parameter markers
("?") in the statement, starting at one. Literal parameter
values in the statement do not increment the ordinal value
of the parameter markers.
In CODE EXAMPLE the two parameter markers have the ordinal
values 1 and 2.
CallableStatement cstmt = con.prepareCall(
"{CALL PROC(?, "Literal_Value", ?)}");
cstmt.setString(1, "First");
cstmt.setString(2, "Third");

Is This Answer Correct ?    4 Yes 1 No

callable is interface or class ?..

Answer / samsudeen

its interface , used for call the procedure, and able to
call the query

Is This Answer Correct ?    2 Yes 0 No

callable is interface or class ?..

Answer / anjani kumar jha

yes
1)statement
2)prepared statement
3)callable statement
all r interface

Is This Answer Correct ?    2 Yes 0 No

callable is interface or class ?..

Answer / vikaas

Callable is an Interface, used to call Stored Procedures.

Is This Answer Correct ?    1 Yes 0 No

callable is interface or class ?..

Answer / ravi jain

ur question is confusing if its simple Callable then it is in

java.util.concurrent package else
if it is

CallableStatement interface

CallableStatement is an interface its super interfaces are:-

PreparedStatement
Statement

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More JDBC Interview Questions

What is JDBC DataSource and what are it’s benefits?

0 Answers  


What is odbc and jdbc?

0 Answers  


What is addbatch jdbc?

0 Answers  


How do I start debugging problems related to the JDBC API?

0 Answers  


What is the difference between executing, executequery, executeupdate in jdbc?

0 Answers  






Does jpa use jdbc?

0 Answers  


What is jdbc drivers in java?

0 Answers  


Which type of driver is unique in jdbc?

0 Answers  


What types of DataSource objects are specified in the Optional Package?

0 Answers  


What is a statement?

0 Answers  


Why jdbc is used in java?

0 Answers  


what is rowset?

3 Answers   Marlabs,


Categories