ResultSet - scrollable should be forward-only

159 views
Skip to first unread message

John O'Hanley

unread,
Dec 22, 2012, 2:14:05 PM12/22/12
to web4j...@googlegroups.com
A user has reported the following problem, while using SqlLite:

14 Dec, 2012 11:22:05 AM hirondelle.web4j.database.SqlFetcher fetchRows
SEVERE: Cannot execute fetch: java.sql.SQLException: SQLite only
supports TYPE_FORWARD_ONLY cursors SQLite only supports
TYPE_FORWARD_ONLY cursors LIST_FACILITIES {
 fSqlText = SELECT Id, Name
 FROM Facility
 ORDER BY Name
 Params = []
}

The cause: internally, when web4j asks for a ResultSet, it uses SqlStatement.java line 200:

// allow scrolling of SELECT result sets
result = aConnection.prepareStatement(aSqlText, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);

A cursory glance at the code base leads me to believe that this line could be changed to scroll-forward, which is the default:

result = aConnection.prepareStatement(aSqlText, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);

Would anyone know of any objection to doing that? Has anyone had to make this modification to their local code base?

John

John O'Hanley

unread,
Jan 16, 2013, 6:09:10 PM1/16/13
to web4j...@googlegroups.com
My cursory glance at the code was too cursory.

web4j needs that kind of scrolling for some operations.

John.
Reply all
Reply to author
Forward
0 new messages