This week's giveaways are in the
MongoDB
and
Jobs Discussion
forums.
We're giving away four copies of
Mongo DB Applied Patterns
and 4 resume reviews from
Five Year Itch
and have the authors/reps on-line!
See
this thread
and
this one
for details.
A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Mongo DB Applied Patterns
this week in the
MongoDB
forum
or a resume review from
Five Year Itch
in the
Jobs Discussion
forum!
JavaRanch
»
Java Forums
»
Databases
»
JDBC
Author
get a limited no of records
kevin Johnson
Greenhorn
Joined: Jul 24, 2001
Posts: 1
posted
Jul 24, 2001 08:19:00
0
Hi there,
resultSet.next gives me all the rows from the table. Is there any way to limit the no of records say only 10??
Thanx.
kevin
// print out records
while(resultSet.next())
{
//String[] row = new
String
[columnCount];
for(int i=1; i<columnCount+1; i++) {>
entry = resultSet.getString(i) + ",";
System.out.println(entry);
}
Daniel Dunleavy
Ranch Hand
Joined: Mar 13, 2001
Posts: 276
posted
Jul 24, 2001 08:44:00
0
setFetchsize
or in Oracle you can have ROWNUM < 11 in the where clause
Dan
I agree. Here's the link:
http://aspose.com/file-tools
subject: get a limited no of records
Similar Threads
getObject() method is not returning the proper result.
Get results from user defined query
comparing two ResultSet
JTable won't display records from database
Making arraylist from resultset
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter