This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes get a limited no of records Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "get a limited no of records" Watch "get a limited no of records" New topic

get a limited no of records

kevin Johnson

Joined: Jul 24, 2001
Posts: 1
Hi there, gives me all the rows from the table. Is there any way to limit the no of records say only 10??

// print out records

//String[] row = new String[columnCount];
for(int i=1; i<columnCount+1; i++) {>
entry = resultSet.getString(i) + ",";

Daniel Dunleavy
Ranch Hand

Joined: Mar 13, 2001
Posts: 276
or in Oracle you can have ROWNUM < 11 in the where clause
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: get a limited no of records
It's not a secret anymore!