Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VlhkW-0005Wx-LY for pgsql-jdbc@arkaria.postgresql.org; Wed, 27 Nov 2013 16:14:00 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VlhkW-0006nR-0n for pgsql-jdbc@arkaria.postgresql.org; Wed, 27 Nov 2013 16:14:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VlhkV-0006nK-4Y for pgsql-jdbc@postgresql.org; Wed, 27 Nov 2013 16:13:59 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VlhkL-0005Ml-9g for pgsql-jdbc@postgresql.org; Wed, 27 Nov 2013 16:13:57 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1VlhkI-00055E-1R for pgsql-jdbc@postgresql.org; Wed, 27 Nov 2013 08:13:46 -0800 Date: Wed, 27 Nov 2013 08:13:46 -0800 (PST) From: David Johnston To: pgsql-jdbc@postgresql.org Message-ID: <1385568825883-5780590.post@n5.nabble.com> In-Reply-To: References: Subject: Re: JDBC & custom type of variable types (!) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 1.8 (+) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org Marc Mamin-2 wrote > Can I rely on a ClassCastException as below to find the correct matching? > even when the custom type has NULL(s) in it ? Even if you could you should not. Generating exceptions is expensive. Try "instanceof" testing instead. I don't know enough bounce custom types in JDBC but as the column has the type, not the value, the result of getObject should be known even if NULL is involved. David J. -- View this message in context: http://postgresql.1045698.n5.nabble.com/JDBC-custom-type-of-variable-types-tp5780512p5780590.html Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com. -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc