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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:47:05+00:00 2026-05-23T13:47:05+00:00

So I’m aware of some relative differences i.e., the ResultSet has an ‘open connection’

  • 0

So I’m aware of some relative differences i.e., the ResultSet has an ‘open connection’ to the database whereas a RowSet works in a ‘disconnected’ fashion.

But that’s pretty much what I understand (may be incorrect):

My question is then this – under what circumstances is one preferable over the other? What are each of their strengths/weaknesses?

  • From what I feel a RowSet, working in
    disconnected mode especially for
    "read-only" queries, would have
    better performance in a highly
    concurrent system. Is that correct?
    If that’s the case is it safe to say
    RowSet is always preferable to
    ResultSet for readonly queries?

  • If I’m correct iterating over the
    RowSet doesn’t throw SQL Exceptions,
    but is that a benefit? The other
    being that RowSet is serializable.
    But my concern is primarily from a
    performance perspective what would be
    the choice?

  • But does it even matter for
    read-write queries?? Can you sync the
    ResultSet back to the DB? (I’m not
    sure if that’s possible (It may be
    and I just can’t recollect or google
    it well enough 🙂 It’s been a while
    with raw JDBC…

Any ideas? There are some missing gaps in my knowledge as is evident 🙂

The reason I ask is I’d like to choose between implementing Spring-JDBC’s ResultSetExtractor Interface versus return an SqlRowSet when processing some data. This question just got me curious to how to decide what to choose when, other than tossing a coin 🙂

  • 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-05-23T13:47:06+00:00Added an answer on May 23, 2026 at 1:47 pm

    RowSet

    RowSet is almost always the right choice, it is more full featured and has all the benefits you listed as well as having specialized implementations for special purposes, like the disconnected CachedRowSet which is what I always use when the data will fit into memory, so I can release the connection back to the pool as quickly as possible to be reused.

    ResultSet should never be part of a public contract.

    A connected ResultSet/Rowset should never escape the method or at worst the object that created them. At least with a RowSet you can disconnect it and the client doesn’t have to care about the implementation. *Unless you are writing JDBC specific library code that interacts or relies on ResultSet specific features or contracts.

    If you are just transferring the results of a query, JDBC specific classes should be part of your public contract.

    Ideally you want to materialize RowSet/ResultSet contents to typesafe Domain Objects to pass around.

    In most cases you want to materialize a List/Set of domain objects to manipulate and work with instead of coupling your code directly to the JDBC api.

    Many modern takes on a ResultSetMapper<T> class exist to handle generating typesafe domain instances using a Visitor pattern because this is the idiomatic way of doing things.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
In my XML file chapters tag has more chapter tag.i need to display chapters

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.