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

  • Home
  • SEARCH
  • 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 8892963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:08:12+00:00 2026-06-14T23:08:12+00:00

Is there a way to loop through Result<Record> from jOOQ in a <c:forEach> ?

  • 0

Is there a way to loop through Result<Record> from jOOQ in a <c:forEach>?

Here’s the getter method:

public Vector<Map<String, String>> getUsers() {
    Factory sql = new Factory(Database.getInstance().connect(), SQLDialect.MYSQL);
    Result<Record> results = sql.select().from("users").fetch();

    Vector<Map<String, String>> v = new Vector<Map<String, String>>();
    for(Record item: results) {
        Map<String, String> m = new HashMap<String, String>();
        m.put("login", item.getValueAsString("login"));
        // other columns
        v.add(m);
    }
    return v;
}

Here’s the view:

<c:forEach var="u" items="${users}">
   ${u.login} <br />
</c:forEach>

Is there way to make my getter method simpler like:

public Result<Record> getUsers() {
    Factory sql = new Factory(Database.getInstance().connect(), SQLDialect.MYSQL);
    reutrn sql.select().from("users").fetch();
}

But as mentioned earlier I don’t know how to loop through it in <c:forEach>, or maybe is it not possible?

  • 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-14T23:08:13+00:00Added an answer on June 14, 2026 at 11:08 pm

    It seems that you would like to operate on records as if they were maps. Here’s how to achieve this with jOOQ:

    public List<Map<String, Object>> getUsers() {
        DSLContext sql = DSL.using(Database.getInstance().connect(), SQLDialect.MYSQL);
      return sql.select().from("users").fetchMaps();
    }
    

    See the relevant Javadocs here:

    • ResultQuery.fetchMaps()
    • Result.intoMaps()
    • Record.intoMap()
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to loop through the same SQLite step result mutiple times.
Is there a way (in jQuery or JavaScript) to loop through each object and
Is there a way to iterate ValueCollection using straight for loop? (not foreach) e.g.
Is there a way to loop in while if you start the script with
is there a way to loop a loop in php? if i got a
Is there any way to loop in NavigableMap in Java? I want to access
Is there a way I can do a for loop for a certain amount
Is there a way to use a loop to create 10 of these, incrementing
Is there any way to use a for-loop in MATLAB with a custom step?
If I have a thread in an infinite loop, is there a way to

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.