Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 26777 invoked from network); 8 Nov 2005 00:55:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Nov 2005 00:55:28 -0000 Received: (qmail 66679 invoked by uid 500); 8 Nov 2005 00:55:26 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 66659 invoked by uid 500); 8 Nov 2005 00:55:26 -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 66648 invoked by uid 99); 8 Nov 2005 00:55:26 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Nov 2005 16:55:26 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of alan@chandlerfamily.org.uk designates 195.188.213.6 as permitted sender) Received: from [195.188.213.6] (HELO smtp-out3.blueyonder.co.uk) (195.188.213.6) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Nov 2005 16:55:19 -0800 Received: from home.chandlerfamily.org.uk ([82.44.22.127]) by smtp-out3.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.6713); Tue, 8 Nov 2005 00:55:53 +0000 Received: from kanger.home ([192.168.0.21]) by home.chandlerfamily.org.uk with esmtp (Exim 4.50) id 1EZHlN-0002eG-7o for user-java@ibatis.apache.org; Tue, 08 Nov 2005 00:55:01 +0000 From: Alan Chandler To: user-java@ibatis.apache.org Subject: Re: confused about storing image data in my database Date: Tue, 8 Nov 2005 00:55:01 +0000 User-Agent: KMail/1.8.2 References: <200511071856.49219.alan@chandlerfamily.org.uk> <200511072227.59867.alan@chandlerfamily.org.uk> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-6" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200511080055.01903.alan@chandlerfamily.org.uk> X-OriginalArrivalTime: 08 Nov 2005 00:55:53.0742 (UTC) FILETIME=[2B972AE0:01C5E3FF] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Monday 07 Nov 2005 23:10, Jeff Butler wrote: > Ah...sorry. > This is sometimes hard to work through. The problem is that bytea doesn't > map easily to a JDBC type - hence the posgresql documentation telling you > exactly what JDBC method to call. If bytea means that you should call > getBytes(), then I think you should use a byte[] in your bean, but NOT > specify type of BLOB in the result map. This will cause iBATIS to use the > ByteArrayTypeHandler, which calls getBytes(). > You can see how iBATIS decides what to do by looking at the class > com.ibatis.sqlmap.engine.type.TypeHandlerFactory. If there is a property of > type byte[], and JDBC type is not BLOB or LONGVARBINARY, then iBATIS will > use the ByteArrayTypeHandler - which should do what you want. > I hope I understand it this time :) Thanks that is exactly what I was after. -- Alan Chandler http://www.chandlerfamily.org.uk Open Source. It's the difference between trust and antitrust.