当前位置: 技术问答>java相关
有没有关闭连接还可以用的缓冲存储的ResultSet?
来源: 互联网 发布时间:2015-06-25
本文导语: 有没有关闭连接还可以用的缓冲存储的ResultSet?比如说CachedResultSet | 很难,按照规范Statement关闭ResultSet就应关闭,否则它找不到更好的回收时机。在大部分优秀的驱动的实现中,ResultSet都是以...
有没有关闭连接还可以用的缓冲存储的ResultSet?比如说CachedResultSet
|
很难,按照规范Statement关闭ResultSet就应关闭,否则它找不到更好的回收时机。在大部分优秀的驱动的实现中,ResultSet都是以流形式存在的,连接断了以后它将无法工作。某些驱动如iNet的SqlServer驱动做了ResultSet的缓冲,但不能保证持久存在。
|
行集和结果集不是一回事,我猜楼主就是因为不能使用JDBC2.0或3.0的一些特性才问的。
但是,基于ResultSet的实现,基本上是不可能。
但是,基于ResultSet的实现,基本上是不可能。
|
我看应该是数据库缓冲池技术!
|
有哇,参见J2EE中的javax.sql.RowSet,功能很强大哦!你可以下载sun的实现。要不,自己做一个也成,呵呵……
|
JDBCTM RowSet
This Early Access release includes three implementations of the JDBCTM RowSet interface. The RowSet interface provides a serializable, scrollable container for tabular data that may or may not be connected to its data source via a JDBC technology-enabled driver.
A disconnected RowSet object, such as a CachedRowSet object or a WebRowSet object, can be thought of as a set of rows that are being cached outside of a data source. Because they are lightweight and serializable, disconnected rowsets can be passed between different components of a distributed application, such as Enterprise JavaBeansTM components. This is one of the most important uses for a RowSet object. The data in a RowSet object may be updated and then resynchronized with the underlying tabular data source.
Please check the below link for more,
http://developer.java.sun.com/developer/earlyAccess/crs/
This Early Access release includes three implementations of the JDBCTM RowSet interface. The RowSet interface provides a serializable, scrollable container for tabular data that may or may not be connected to its data source via a JDBC technology-enabled driver.
A disconnected RowSet object, such as a CachedRowSet object or a WebRowSet object, can be thought of as a set of rows that are being cached outside of a data source. Because they are lightweight and serializable, disconnected rowsets can be passed between different components of a distributed application, such as Enterprise JavaBeansTM components. This is one of the most important uses for a RowSet object. The data in a RowSet object may be updated and then resynchronized with the underlying tabular data source.
Please check the below link for more,
http://developer.java.sun.com/developer/earlyAccess/crs/
|
连接关闭了ResultSet一定被清掉了
所谓没有关掉,也只是自己多封装了缓冲进去。
所谓没有关掉,也只是自己多封装了缓冲进去。
|
自己做数组把数据存在client,
|
好象不可能,除非自已已经把记录缓存了!
|
有!
j2ee的sun.jdbc.rowset.CachedRowSet就是
你可以到sun下载!
他是非连接的,可以不用保持一个连接对象!