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   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Java J2EE  >>  Java Related  >>  JDBC
 
 


 

 
 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
i have 1000 records in resultset, how to get first 100 
records from resultset, because resultset fetch all 1000 
records at a time?
 Question Submitted By :: Shaikrafi
I also faced this Question!!     Rank Answer Posted By  
 
  Re: i have 1000 records in resultset, how to get first 100 records from resultset, because resultset fetch all 1000 records at a time?
Answer
# 1
If your intention is to dislay only 100 records to the 
user, then better make the change the query to retrieve 
first 100 recs. (like say fetch first 100 rows in Db2).
 
Is This Answer Correct ?    2 Yes 0 No
A Kumar
 
  Re: i have 1000 records in resultset, how to get first 100 records from resultset, because resultset fetch all 1000 records at a time?
Answer
# 2
ResultSet.getRow() will give you the row number where the
resultset cursor is in , check for ResultSet.getRow()==100
and then break out of the loop
 
Is This Answer Correct ?    2 Yes 1 No
Sri
 
 
 
  Re: i have 1000 records in resultset, how to get first 100 records from resultset, because resultset fetch all 1000 records at a time?
Answer
# 3
GO ON LINK JAVATEACHER.CO.IN AFTER THAT CLICK JSP ,,,,THERE
IS AN EXAMPLE OF PAGINATION SHOW THAT EXAMPLE THAT IS
PERFECT EXAMPLE FOR U
 
Is This Answer Correct ?    0 Yes 0 No
Saket
 
  Re: i have 1000 records in resultset, how to get first 100 records from resultset, because resultset fetch all 1000 records at a time?
Answer
# 4
the is a syntax in sql    'limit'....using this u can get
desired number of rows...

suppose database having 1000 rows..

query will be:

select * from table limit 100;

first 100 rcds will be selected...
 
Is This Answer Correct ?    0 Yes 1 No
Ravi
 
  Re: i have 1000 records in resultset, how to get first 100 records from resultset, because resultset fetch all 1000 records at a time?
Answer
# 5
query should be prepare like this


select * from tab_name where rownum <= 100
 
Is This Answer Correct ?    1 Yes 1 No
Dmk.java@gmail.com
 
  Re: i have 1000 records in resultset, how to get first 100 records from resultset, because resultset fetch all 1000 records at a time?
Answer
# 6
SELECT TOP 100 from MyTable;
 
Is This Answer Correct ?    1 Yes 1 No
Kuldeep Raaj Sharma
 
  Re: i have 1000 records in resultset, how to get first 100 records from resultset, because resultset fetch all 1000 records at a time?
Answer
# 7
There is two ways to getting the limited records from the 
DB.
1)we can use sql command :
set rowcount 100 select * from mytab.

2)Instead of set rowcount you can use setMaxRow(100) method.
 
Is This Answer Correct ?    0 Yes 0 No
Chandra
 

 
 
 
Other JDBC Interview Questions
 
  Question Asked @ Answers
 
what is call level interface?  1
What is a PreparedStatement? Infosys2
What is Type-3 Driver and when this driver is used? Wipro3
is that compulsory to have Primarykey-forignkey for joints (outer inner,equal) IonIdea1
Without using of Class.forName(? ?), how do you connect to db? IBM1
Different statements in JDBC?  2
Does multiple concurrent open statements per connection are supported by the JDBC-ODBC Bridge?  1
What is an outer join? Infogain1
what is metadata and it's use?  2
What is execute(), executeUpdate() and executeQuery() methods?  3
Is there any limitation for no of statments executed with in batchupdate? HSBC2
What are the different types of modifiers?  1
What is the difference between Union, Unionall ?  1
How a driver can be loaded?  1
Are there any ODBC drivers that do not work with the JDBC- ODBC Bridge?  1
What type of drivers have you used?  1
What is meant by a ResultSet?  3
Can we make a database connection from HTML ? BOB-Technologies1
r u used any design patterns in your project? Wipro3
Can we use the one instance of Statment to execute more than one query ? TCS2
 
For more JDBC 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