Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8575909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:48:09+00:00 2026-06-11T19:48:09+00:00

List userProcessedCountCol = new ArrayList(); while (iResultSet1.next()) { afRealTimeIssuance afRealTimeIssuance = new afRealTimeIssuance(); Integer

  • 0
        List userProcessedCountCol = new ArrayList();
                  while (iResultSet1.next()) {
                        afRealTimeIssuance afRealTimeIssuance = new afRealTimeIssuance();
                        Integer i = 0;

                        afRealTimeIssuance.setSub_channel(iResultSet1.getString(++i));
                        afRealTimeIssuance.setAgent_names(iResultSet1.getString(++i));
                        afRealTimeIssuance.setFtd(iResultSet1.getDouble(++i));
                        afRealTimeIssuance.setMtd(iResultSet1.getDouble(++i));
                        afRealTimeIssuance.setQtd(iResultSet1.getDouble(++i));

                        userProcessedCountCol.add(afRealTimeIssuance);
}

where afRealTimeIssuance is ActionForm

Using the above snippet I get something like below output

1             A             100
2             B             200
3             C             300
4             D             400

But I want to rearrange the output as

2            B              200
4            D              400
3            C              300
1            A              100

In short I want to rearrange the rows as I want.How to arrange the resultset data based on one particular value.Please guide

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:48:10+00:00Added an answer on June 11, 2026 at 7:48 pm

    The ResultSet cannot be rearranged manually (only with sql) . What you can rearrange is your data structure that you hold your Objects

    You can use an ArrayList of your row Objects and insert each row in the position you would like.

    Lets say in your example, in the while loop:

    userProcessedCountCol.add(index, element);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

List<Object> myList = new ArrayList<String>(); //(hint: no) Map<Integer> myMap = new HashMap<int>(); // (hint:
List<String> listStr = new ArrayList<String>(); if(listStr.size == 0){ } versus if(listStr.isEmpty()){ } In my
List<String> listA = new ArrayList<String>(); listA.add(a); listA.add(b); listA.add(c); listA.add(d); List<String> listB = new ArrayList<String>();
List<Question> questions = new ArrayList<Question>(); questions.addAll(getAllQuestions()); //returns a set of Questions Collections.sort(questions, new BeanComparator(questionId));
List CreateNewStatements(ForLoop L) { List stmts = new ArrayList(); FlatIterator iter = new FlatIterator(L.getBody());
List<Data> list = new ArrayList<Data>(); public class Data{ public int n; public String p;
List list = new ArrayList(); String[] test = {ram, mohan, anil, mukesh, mittal}; for(int
List l = new ArrayList<Number>(); List<String> ls = l; // unchecked warning l.add(0, new
List<String> flowers = new ArrayList<String>(); My for loop currently looks like this... for (int
List<Integer> list0 = new List1<Integer>(); a) Is the word List a keyword in java??

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.