Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 64909 invoked from network); 8 Feb 2009 09:23:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Feb 2009 09:23:18 -0000 Received: (qmail 82931 invoked by uid 500); 8 Feb 2009 09:23:12 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 82914 invoked by uid 500); 8 Feb 2009 09:23:12 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 82905 invoked by uid 99); 8 Feb 2009 09:23:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Feb 2009 01:23:12 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.219.17] (HELO mail-ew0-f17.google.com) (209.85.219.17) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Feb 2009 09:23:03 +0000 Received: by ewy10 with SMTP id 10so1862702ewy.0 for ; Sun, 08 Feb 2009 01:22:42 -0800 (PST) Received: by 10.210.43.11 with SMTP id q11mr2877979ebq.61.1234084961499; Sun, 08 Feb 2009 01:22:41 -0800 (PST) Received: from ?192.168.0.20? (82-197-193-204.dsl.cambrium.nl [82.197.193.204]) by mx.google.com with ESMTPS id h6sm11977280nfh.64.2009.02.08.01.22.40 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 08 Feb 2009 01:22:41 -0800 (PST) Message-ID: <498EA460.1010400@tigrou.nl> Date: Sun, 08 Feb 2009 10:22:40 +0100 From: Rob Sonke User-Agent: Thunderbird 2.0.0.19 (Macintosh/20081209) MIME-Version: 1.0 To: user-java@ibatis.apache.org Subject: Re: custom type handler w/ database-specific type References: <498CCB15.3070609@noaa.gov> <498E1D29.9010108@noaa.gov> In-Reply-To: <498E1D29.9010108@noaa.gov> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org DO you need access to the DataSource or the Connection? Rob John Cartwright wrote: > I think I've worked around this problem by explicitly specifying the > handler class w/in the in-line parameter map. > Now I seem to have the problem of TypeHandler class needing access to > the DataSource... > > --john > > > John Cartwright wrote: >> Hello All, >> >> I'm trying to implement a custom type handler to support Oracle's >> SDO_GEOMETRY type. I've got it (apparently) working for retrieval of >> data, but am having trouble w/ inserts into the database. Error says: >> >> org.springframework.jdbc.UncategorizedSQLException: SqlMapClient >> operation; uncategorized SQLException for SQL []; SQL state [null]; >> error code [0]; --- The error occurred in >> gov/noaa/ngdc/mgg/ufn/Feature.xml. --- The error occurred while >> applying a parameter map. --- Check the >> Feature.insertShape-InlineParameterMap. --- Check the parameter >> mapping for the 'geometry' property. --- Cause: >> java.lang.NullPointerException; nested exception is >> com.ibatis.common.jdbc.exception.NestedSQLException: --- The error >> occurred in gov/noaa/ngdc/mgg/ufn/Feature.xml. --- The error >> occurred while applying a parameter map. --- Check the >> Feature.insertShape-InlineParameterMap. --- Check the parameter >> mapping for the 'geometry' property. --- Cause: >> java.lang.NullPointerException >> >> I'm registering a global type handler w/: >> >> > callback="gov.noaa.ngdc.mgg.ufn.dao.ibatis.SdoGeometryHandler" >> javaType="com.vividsolutions.jts.geom.Geometry" >> jdbcType="SDO_GEOMETRY" /> >> >> >> and the inline parameter map for the "geometry" column uses: >> >> #geometry:SDO_GEOMETRY# >> >> >> I've tried various other values for JDBC types: STRUCT, OTHER >> w/o success. >> >> Can someone please help me understand a little better about the >> connections between the the types in the parameter map and the >> typehandler registration? >> >> Thanks! >> >> --john >>