On 25 Apr 2004, at 00:43, Oliver Jowett wrote:
<excerpt>Moray Taylor wrote:
<excerpt>Does this mean the absolute() method will not work on any
ResultSet that I get from a query?
absolute() row access is totally critical to my application, will I
need to stick with 7.5 build 301?
</excerpt>
If you want to use absolute() (or relative(), first(), last(),
prev()), you must specify TYPE_SCROLLABLE_xxx when creating the
statement, per the spec. The default is TYPE_FORWARD_ONLY, which as
the name implies creates resultsets that can only be iterated through
forwards using next(). See the ResultSet javadoc for details:
http://java.sun.com/j2se/1.4.2/docs/api/java/sql/ResultSet.html
-O
</excerpt>
I use this code,
<fixed>stmt =
DBConnection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);</fixed>
but still get this error
ERROR:Operation requires a scrollable resultset, but this resultset is
FORWARD_ONLY.
org.postgresql.util.PSQLException: Operation requires a scrollable
resultset, but this resultset is FORWARD_ONLY.
do I need to specify anything else in the statment?
Thanks v much
Moray
On 25 Apr 2004, at 00:43, Oliver Jowett wrote:
> Moray Taylor wrote:
>> Does this mean the absolute() method will not work on any ResultSet
>> that I get from a query?
>> absolute() row access is totally critical to my application, will I
>> need to stick with 7.5 build 301?
>
> If you want to use absolute() (or relative(), first(), last(),
> prev()), you must specify TYPE_SCROLLABLE_xxx when creating the
> statement, per the spec. The default is TYPE_FORWARD_ONLY, which as
> the name implies creates resultsets that can only be iterated through
> forwards using next(). See the ResultSet javadoc for details:
>
> http://java.sun.com/j2se/1.4.2/docs/api/java/sql/ResultSet.html
>
> -O
>
I use this code,
stmt =
DBConnection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet
.CONCUR_UPDATABLE);
but still get this error
ERROR:Operation requires a scrollable resultset, but this resultset is
FORWARD_ONLY.
org.postgresql.util.PSQLException: Operation requires a scrollable
resultset, but this resultset is FORWARD_ONLY.
do I need to specify anything else in the statment?
Thanks v much
Moray