ResultSet.TYPE_SCROLL_INSENSITIVE replaced with TYPE_FORWARD_ONLY

69 views
Skip to first unread message

John O'Hanley

unread,
Sep 24, 2013, 2:41:08 PM9/24/13
to web4j...@googlegroups.com
Hi,

A user had this error:
"I am trying out the electricity application with SQLite as the database. During the
startup of Tomcat, it gives an error that SQLite only supports
type_forward_only cursors. "

This was due to the web4j internals (SqlStatement.java, line 200):
result = aConnection.prepareStatement(aSqlText, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);

I would like to change this to:
result = aConnection.prepareStatement(aSqlText, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);

As far as I can see, web4j doesn't need the result set to be scrollable. The type-forward-only is the simplest form of result set, so it should be supported by any reasonable db/driver.

If you know of any objection to this change, let me know...the internal result set above doesn't leak out to the application, so it's likely a change that will no zero ripple effects.

- John




John O'Hanley

unread,
Sep 24, 2013, 2:49:18 PM9/24/13
to web4j...@googlegroups.com
The scrolling is used when creating some special kinds of model objects.  ModelFromRow uses it...
Reply all
Reply to author
Forward
0 new messages