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 8548377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:28:53+00:00 2026-06-11T13:28:53+00:00

Is there a Jdbc standard a way to filter the result return by a

  • 0

Is there a Jdbc standard a way to filter the result return by a jdbcTemplate.query by offset and limit?

Also is there a simple way to transform a ResultSet (returned by a filtered query, like the above) into a List<Map<String,String>> result? Where the List is the row where the row values is stored in the Map? The row name being the map key and the row value being the map value.

Or there is a standard way of getting the rows out of a ResultSet?

  • 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-11T13:28:55+00:00Added an answer on June 11, 2026 at 1:28 pm

    Take a look at JdbcTemplate#setMaxRows(int)

    http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/jdbc/core/JdbcTemplate.html#setMaxRows%28int%29

    This should apply a LIMIT/TOP.

    —

    I don’t think OFFSET is so well defined, you may need to shoehorn that into your SQL statement in the relevant SQL dialect.

    —

    To filter the rows returned by JDBC driver and possibly build into Java user-defined object types look at check out the ResultSetExtractor and RowMapper.

    ResultSetExtractor this is used to iterate over the ResultSet using ResultSet#next() this allows it to filter and skip based on business logic. This method might make use of a RowMapper type to extract a single row of data it wants to keep, or it may do the extraction itself.

    http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/jdbc/core/ResultSetExtractor.html

    RowMapper this is used to make a single row into some valid, it could just be a List. This method uses ResultSet#getWhatever(int).

    http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/jdbc/core/RowMapper.html

    Then check the JdbcTemplate methods that take a ResultSetExtractor type as one of the arguments. This maybe a good example to start with:

    http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/jdbc/core/JdbcTemplate.html#query%28java.lang.String,%20java.lang.Object%5B%5D,%20org.springframework.jdbc.core.ResultSetExtractor%29

    • 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 stop or terminate long running Oracle query in JDBC
There is a way to specify IBatis query timeout using oracle jdbc and Java?
Is there a way to enable MySQL general query logging through JDBC? The closest
I am trying to connect to DB using the standard JDBC way connection =
I'm using JDBC to query a Teradata server. There are up to 100 simultaneous
Is there a built-in way to escape user input in java using the JDBC
Is there a way to access jdbc/ jndi resource properties associated with a Datasource
Is there a way to get a olap4j.OlapConnection from a org.h2.jdbc.JdbcConnection ? Right now
Is there an equivalent of (ADO.NET) DB.Null in JDBC? Or do I simply pass
I've used JDBC in several applications now to query Derby, PostgreSQL and now MySQL

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.