How to create a scrollable ResultSet?

余生长醉 提交于 2019-12-05 23:44:00

Most likely the combination of TYPE_SCROLL_INSENSITIVE is not compatible with CONCUR_UPDATABLE. According to the JDBC specification, a driver is free to downgrade a ResultSet if it can't service the requested scrollability and/or concurrency mode. See also: http://jtds.sourceforge.net/resultSets.html :

TYPE_SCROLL_INSENSITIVE | Static cursor | Heavy | Only works with read-only concurrency (updatable is downgraded). SQL Server generates a temporary table, so changes made by others are not visible. Scrollable.

Which confirms that the driver will downgrade when specifying CONCUR_UPDATABLE.

You might want to consider using TYPE_SCROLL_SENSITIVE or simply not combine scrollability with updatability.

jTDS TYPE_SCROLL_INSENSITIVE only supports the read-only operations.

Change ResultSet.TYPE_SCROLL_INSENSITIVE to ResultSet.TYPE_SCROLL_SENSITIVE

See http://www.anyang-window.com.cn/jtds-on-the-database-connection-resultset-is-read-only/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!