Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Records to be displayed in ascending order retrived by calling a function through java program

 
haripriya vedula
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have called a function from my java program which gets results and displays in jsp.

Records are displayed in descending order.
I need to display the records in ascending format . In DB I cannot edit and change the select .... orderby ...query, we dont have permissions to do that.

Any help is appreciable.

Thanks in advance

 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can change your method to sort your collection of results after you've got them.
 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
haripriya vedula wrote:Hi,

I have called a function from my java program which gets results and displays in jsp.

Records are displayed in descending order.
I need to display the records in ascending format . In DB I cannot edit and change the select .... orderby ...query, we dont have permissions to do that.

Any help is appreciable.

Thanks in advance


You probably will have to sort the returned collection in your java code, like Paul said. First, though, check the API for this "function" you have to call. You may find that there is an argument that controls sort order.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic