ResultSet.TYPE_SCROLL_SENSITIVE
怎么样?实际上可以在 JDBC 中工作吗?
Statement stmt = conn.createStatement(
ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_READ_ONLY);`
最佳答案
The type of a
ResultSet
object determines the level of its functionality in two main areas: (1) the ways in which the cursor can be manipulated and (2) how concurrent changes made to the underlying data source are reflected by theResultSet
object. The latter is called the sensitivity of theResultSet
object.The three different
ResultSet
types are described below.[...]
3.
TYPE_SCROLL_SENSITIVE
- The result set is scrollable; its cursor can move both forward and backward relative to the current position, and it can move to an absolute position.
- The result set reflects changes made to the underlying data source while the result set remains open.
The default
ResultSet
type isTYPE_FORWARD_ONLY
.The method
DatabaseMetaData.supportsResultSetType
returnstrue
if the specified type is supported by the driver andfalse
otherwise.If the driver does not support the type supplied to the methods
createStatement
,prepareStatement
, orprepareCall
, it generates anSQLWarning
on theConnection
object that is creating the statement. When the statement is executed, the driver returns aResultSet
object of a type that most closely matches the requested type. An application can find out the type of aResultSet
object by calling the methodResultSet.getType
.
关于java - JDBC 结果集类型滚动敏感,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42622929/