Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 87B272E33AF for ; Sat, 1 Dec 2007 03:53:38 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 64648-02 for ; Sat, 1 Dec 2007 03:53:33 -0400 (AST) Received: from live.cleverthinking.co.uk (server217-174-252-150.live-servers.net [217.174.252.150]) by postgresql.org (Postfix) with ESMTP id 5502B2E01C2 for ; Sat, 1 Dec 2007 03:53:34 -0400 (AST) Received: from fh1 ([217.174.252.150]) by live.cleverthinking.co.uk (JAMES SMTP Server 2.3.0) with SMTP ID 898 for ; Sat, 1 Dec 2007 07:53:28 +0000 (GMT) Message-ID: <475112C4.9060403@primetext.com> Date: Sat, 01 Dec 2007 07:52:36 +0000 From: Roy Smith User-Agent: Thunderbird 2.0.0.0 (X11/20070419) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: "create type" custom types not supported by JDBC Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200712/1 X-Sequence-Number: 17856 I'm getting errors when I'm trying to access my custom data types through JDBC. If I don't supply a custom map using Connection.setTypeMap() then I'm getting ... org.postgresql.util.PGobject cannot be cast to Money at ... Money m = (Money) resultSet.getObject(1); // Money is my class to handle multi-currency money types If I add a mapping with ... map.put("couk_cleverthinking_gwappo_currency",Class.forName("Money") ) connection.setTypeMap(map) Then I get ... java.lang.ClassCastException: java.lang.Class cannot be cast to java.sql.SQLData at org.postgresql.jdbc2.AbstractJdbc2Connection.getObject(AbstractJdbc2Connection.java:403) Poking around the source code of AbstractJdbc2Connection it looks like this functionality isn't support. Please could somebody confirm this is the cause and offer any insights as to when it might be included. Perhaps an "Unsupported feature" error would be more helpful than a ClassCastException. Very best wishes Roy