DataAdapter with big data



  • Is there in nature, some lazy DataAdapter♪ that's the one that pulls ♪ DataSet recordings, if necessary, or for N records at a time?

    Sometimes it's not rational to store all the data in view of their large volume, and you want to update a little, return the data back to the server and take the next piece.

    Anything ready?

    Sure, you can use your hands, but maybe something's up to me and you don't have to bicycle?



  • Use it. Hibernate for such purposes. Manuals are a lot, but the idea is, setFirstResult and setMaxResultswhere you're pointing out the windows.

    public List<Cat> findCats(String name, int offset, int limit) {
    
    Query q = session.createQuery("from Cat where name=:name");
    
    q.setString("name", name);
    
    if (offset &gt; 0) {
        q.setFirstResult(offset);
    }
    if (limit &gt; 0) {
        q.setMaxResults(limit);
    }
    
    return q.list();
    

    }

    There's a solution to that. https://stackoverflow.com/questions/168084/is-there-a-more-efficient-way-of-making-pagination-in-hibernate-than-executing-s




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2