Issue Details (XML | Word | Printable)

Key: JDBC-475
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Mark Rotteveel
Reporter: Mark Rotteveel
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Jaybird JCA/JDBC Driver

Statement + ResultSet setFetchDirection should ignore FETCH_REVERSE and FETCH_UNKNOWN instead of throwing an exception

Created: 28/Jan/17 12:13 PM   Updated: 05/Mar/17 01:00 PM
Component/s: None
Affects Version/s: None
Fix Version/s: Jaybird 3.0.0-beta-3, Jaybird 3.0.0


 Description  « Hide
Statement + ResultSet setFetchDirection should ignore FETCH_REVERSE and FETCH_UNKNOWN instead of throwing an exception

See also section 13.5 of JDBC 4.2:

"Hints provided to the driver via this interface may be ignored by the driver if they are not appropriate."

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mark Rotteveel added a comment - 28/Jan/17 01:57 PM
FETCH_REVERSE and FETCH_UNKNOWN are now always allowed on statement, and inherited by the result set. FETCH_REVERSE and FETCH_UNKNOWN are now allowed to be set on a scrollable result set.

The JDBC spec is a bit ambiguous about it, so setting FETCH_REVERSE and FETCH_UNKNOWN is allowed on a non-scrollable statement, and will be inherited as such by the non-scrollable result set, but setting that same value explicitly on a non-scrollable result set itself is not allowed and will throw an exception. This is similar to what the PostgreSQL JDBC driver does.

We ignore the hint entirely.

As part of this changed, calling get/setFetchDirection on a closed statement or closed result set will always result in an SQLException (this was done inconsistently).