ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
How to call a Stored Procedure from JDBC?
 Question Submitted By :: Gopalraop
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How to call a Stored Procedure from JDBC?
Answer
# 1
We can use CallableStatement interface to call a stored 
procedure.Use the following steps.

1. crate the escape syntax like
String sql="{call procname(?,?,?);
2.CallableStatement cst=con.prepareCall(sql);
3.Set the inparameters using setXXX methods like
cst.setInt(1,10);
cst.setString(2,"abc");
4.Register the out parameter
cst.registerOutParameter(1,Types.Float);
5.Submit the statement using
cst.execute();
6. We can get the data from stored procedure using getXXX 
methods
 
Is This Answer Correct ?    1 Yes 0 No
Gajendra
 
  Re: How to call a Stored Procedure from JDBC?
Answer
# 2
use callableStatment
 
Is This Answer Correct ?    0 Yes 0 No
Vikneswarank
[Jadian]
 
 
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
long d =10;int i =0;i=d; /// is this possible? If d is very long number (10 digits or some thing) then?  1
A class can be a subclass of itself? Genesis1
how can we use the servlet as standalone apllication?should we need to extend any class? Logica-CMG2
What happens if an exception is not caught?  4
Can we declare an anonymous class as both extending a class and implementing an interface? Wipro6
What is the use join() in Threads ? HCL3
different types of threads? TCS5
what is an anonymous class? TCS5
How are Java source code files named?  2
What is the return type of a program?s main() method?  2
Default layout of Dialog object?  1
How many bits are used to represent unicodde,ASCII,UTF-16 and UTF-8 characters?  2
Which method will get invoked first in a stand alone application?  1
what is polymorphism with example?types of polymorphism? HP5
What is static variable and static method? TCS4
how to handle http request in struts Polaris2
Thanks A.jyotsna, Can u tell me differnce between abstract class and interface vikash  3
what is finalmethod & final variable with example? HP2
How Applets & Servlets will communicate with each other?  2
What is the frontend and backedn in Java? TCS2
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com