Problems with ResultSet.relative()
When I try and use ResultSet.relative() and ResultSet.absolute() I get a runtime error stating Result set type is TYPE_FORWARD_ONLY. This doesn't make sense because I am calling ResultSet.setFetchDirection(ResultSet.FETCH_FORWARD) before using relative/absolute and I am using positive numbers for these methods. Does anyone know why this is happening?
Thanks in advanced
# 1
> I get a runtime error stating
> Result set type is TYPE_FORWARD_ONLY.
> This doesn't make sense because I am calling
> ResultSet.setFetchDirection(ResultSet.FETCH_FORWARD)
> before using relative/absolute and I am using
> positive numbers for these methods.
Why does it not make sense? The runtime error is telling you exactly what you have done.
# 2
And also setting fetch direction has nothing at all to do with the result set type. If you want a scrollable cursor you need to do that eariler when the result set is created.
Fetch direction is a way to provide a hint to the driver about which way you are planning to access the results. This hint is only given as a way to optionally improve performance. But it has no bearing whatsoever on the result set type.