Does a ResultSet load all data into memory or only when requested?

前端 未结 5 826
眼角桃花
眼角桃花 2020-11-30 04:57

I have a .jsp page where I have a GUI table that displays records from an Oracle database. This table allows typical pagination behaviour, such as \"FIRST\", \"NEXT\", \"PRE

5条回答
  •  半阙折子戏
    2020-11-30 05:22

    While the JDBC spec does not specify whether or not the all data in the result set would get fetched, any well-written driver won't do that.

    That said, a scrollable result set might be more what you have in mind: (link redacted, it pointed to a spyware page)

    You may also consider a disconnected row set, that's stored in the session (depending on how scalable your site needs to be): http://java.sun.com/j2se/1.4.2/docs/api/javax/sql/RowSet.html

提交回复
热议问题