X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 5B865D83BC for ; Thu, 22 Sep 2005 23:04:49 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 89695-10 for ; Fri, 23 Sep 2005 02:04:43 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id A6E5AD6F38 for ; Thu, 22 Sep 2005 23:04:43 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1EIcve-0003zB-EF; Fri, 23 Sep 2005 14:04:46 +1200 Message-ID: <433362BD.5030606@opencloud.com> Date: Fri, 23 Sep 2005 14:04:45 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050324) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jeffrey Melloy Cc: pgsql-jdbc@postgresql.org Subject: Re: Result Set FORWARD_ONLY References: <7EAC0D28-F7CC-4924-8244-CF8AD2874314@visualdistortion.org> In-Reply-To: <7EAC0D28-F7CC-4924-8244-CF8AD2874314@visualdistortion.org> X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.008 required=5 tests=[AWL=0.008] X-Spam-Level: X-Archive-Number: 200509/101 X-Sequence-Number: 13886 Jeffrey Melloy wrote: > pstmt = conn.prepareStatement("select name, name from > amz.product_detail_items order by name"); > rs = pstmt.executeQuery(); > rs.setFetchDirection(ResultSet.TYPE_SCROLL_INSENSITIVE); > > I get: > > org.postgresql.util.PSQLException: Invalid fetch direction constant: 1,004. The driver is working correctly here. You can only set the resultset type when creating the statement, like so: > pstmt = conn.prepareStatement("select name, name from amz.product_detail_items order by name", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); ResultSet.setFetchDirection() is used to hint to the driver about the expected order of resultset use, not to set the resultset type. It expects one of ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE, or ResultSet.FETCH_UNKNOWN. The driver is (correctly) complaining that you're giving it some other value. The java.sql javadoc covers all this. -O