Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 9D0889FBE75 for ; Thu, 28 Jun 2007 06:58:45 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 55550-03 for ; Thu, 28 Jun 2007 06:58:38 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail.ukfsn.org (s2.ukfsn.org [217.158.120.143]) by postgresql.org (Postfix) with ESMTP id 9A3F19FB798 for ; Thu, 28 Jun 2007 06:58:40 -0300 (ADT) Received: from localhost (mailman.ukfsn.org [80.168.53.75]) by mail.ukfsn.org (Postfix) with ESMTP id 31ECDE6C5F for ; Thu, 28 Jun 2007 10:58:09 +0100 (BST) Received: from mail.ukfsn.org ([80.168.53.20]) by localhost (smtp-filter.ukfsn.org [80.168.53.75]) (amavisd-new, port 10024) with ESMTP id iWTWTdWRjsYA for ; Thu, 28 Jun 2007 10:57:38 +0100 (BST) Received: from stargate.local (84-45-236-142.no-dns-yet.enta.net [84.45.236.142]) by mail.ukfsn.org (Postfix) with ESMTP id E6E66E6C47 for ; Thu, 28 Jun 2007 10:58:08 +0100 (BST) From: David Goodenough To: pgsql-jdbc@postgresql.org Subject: setObject type for Interval objects Date: Thu, 28 Jun 2007 10:58:17 +0100 User-Agent: KMail/1.9.6 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200706281058.19601.david.goodenough@btconnect.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.617 tagged_above=0 required=5 tests=AWL=-0.427, BAYES_50=0.001, DNS_FROM_RFC_ABUSE=0.2, DNS_FROM_RFC_POST=1.708, FORGED_RCVD_HELO=0.135 X-Spam-Level: * X-Archive-Number: 200706/111 X-Sequence-Number: 17173 I have an SQL SELECT which contains an expressions of the form:- WHERE created < CURRENT_TIMESTAMP - ? where created is a TIMESTAMP field. As a parameter I want to pass an interval, so I used:- PGInterval interval = new PGInterval( intervalPeriod); stmt.setObject( 1, interval); but Postgresql objects with:- org.postgresql.util.PSQLException: Can't infer the SQL type to use for an instance of org.postgresql.util.PGInterval. Use setObject() with an explicit Types value to specify the type to use. So I guess I need the three parameter setObject, but I do not know what type to pass to the third parameter. I have googled, but to no avail (I obviously asked the wrong question). David