ALLInterview.com :: Home Page            
 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                      
Google
   
 
Categories >> Software >> Java Related >> Java J2EE >> JDBC
 
 


 

 
 Core Java interview questions  Core Java Interview Questions (1721)
 Advanced Java interview questions  Advanced Java Interview Questions (331)
 Swing interview questions  Swing Interview Questions (44)
 EJB interview questions  EJB Interview Questions (134)
 Servlets interview questions  Servlets Interview Questions (255)
 Struts interview questions  Struts Interview Questions (196)
 JDBC interview questions  JDBC Interview Questions (187)
 JMS interview questions  JMS Interview Questions (9)
 SunOne interview questions  SunOne Interview Questions (3)
 J2EE interview questions  J2EE Interview Questions (71)
 Weblogic interview questions  Weblogic Interview Questions (146)
 Websphere interview questions  Websphere Interview Questions (14)
 Java Networking interview questions  Java Networking Interview Questions (20)
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions (87)
Question
What are the different types of statements?
 Question Submitted By :: JDBC
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
Statement interface----createStatement() method is useful
to create statement object and to execute simple queries...

PreparedStatement interface---derived from the Statement
interface...preparestatement() method used to create
preparedstatement object and used to execute queries with
unknown parameters or where in the parameters are provided
at the run-time

CallabaleStatement interface----derived from the
preparedstatement interface and helpful in executing stored
procedures...prepareCall() method is used to create the
callabalestatement object
 
Is This Answer Correct ?    45 Yes 6 No
Chandrarekha
 
Answer
# 2
statement
preparedstatement
callable sattement
 
Is This Answer Correct ?    29 Yes 9 No
Niranjanravi
 
 
 
Answer
# 3
there are 3 types of statements used in jdbc
------
1.createStatement()
2.preparedStatement()
3.callableStatement()


createStatement returns the object of statement.through this we can call methods belongs

to the statement interface.preparedStatement returns the object of preparedstatement.through this we can call methods belongs

to the preparedstatement interface.

The difference b/w statement and preparedstatement is :

if we use statement the sql querry parses by the database server each and every time.when

we send the request. but by using preparedstatement the sql querry parses only once and that

parsed querry is used every time.

for example if there are 100 sql statements by using statement 100 parsings are necessary.

but by using preparedStatement the parsing is happened only once.so we can save the 99 parsings.

The callablestatement is used to call the storedprocedures.
 
Is This Answer Correct ?    14 Yes 3 No
Rashmi
 
Answer
# 4
There are four types of statements(not no which). 
Is This Answer Correct ?    8 Yes 14 No
Lol
 

 
 
 
Other JDBC Interview Questions
 
  Question Asked @ Answers
 
java.lang.ClassNotFoundException:oracle.jdbc.driver.OracleDr iver? I get this error at run time.I used oracle10G. I set CLASS PATH:C:\oraclexe\app\oracle\product\10.2.0 \server\jdbc\lib\ojdbc14.jar; I write JDBC PROGRAM like import java.sql.*; class Example { public static void main(String args[]) { try { Class.forName ("oracle.jdbc.driver.OracleDriver"); System.out.println("Driver Loaded"); Connection con=DriverManager.getConnection ("jdbc:oracle:thin:@localhost:1521:xe","system","salmas"); System.out.println("Driver Connected"); Statement st=con.createStatement(); ResultSet rs=st.executeQuery("select * from emp"); while(rs.next()) { System.out.println(rs.getInt(1)); System.out.println(rs.getString(2)); System.out.println(rs.getString(3)); } st.close(); con.close(); } catch(Exception e) { System.out.println(e); } finally { System.out.println("it's finally block executed"); } } }   6
HI ALL, How to Overcome "OutOfMemoryException"? when I am compiling source having more than 1000 LOC throwing this exception. Can any one give correct answer to my question? thx   5
How is jndi useful for Database connection?   1
what is the difference between SENSITIVE and INSENSITIVE?   1
how can we get the metaData (columnNames) from a table which has no Records..   2
What type of drivers are used for web application?   2
What is an outer join? Infogain 3
What is the use of prepared statement?Ans:used to execute pre compiled statement...so the question is when that precompiled statement will be execute or comiple?................ TCS 6
What is the syntax of URL to get connection?   1
What is the latest version of JDBC? What new features are added?   4
What are pros and cons of using of Type-2 and Type-4 Drivers over Type-1 driver? IBM 4
What is the difference between triggers and procedures?   1
 
For more JDBC Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com