Return-Path: Mailing-List: contact ibatis-user-java-help@incubator.apache.org; run by ezmlm Delivered-To: mailing list ibatis-user-java@incubator.apache.org Received: (qmail 23988 invoked by uid 99); 18 Feb 2005 04:32:16 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of bdruth@gmail.com designates 64.233.184.206 as permitted sender) Received: from wproxy.gmail.com (HELO wproxy.gmail.com) (64.233.184.206) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 17 Feb 2005 20:32:13 -0800 Received: by wproxy.gmail.com with SMTP id 69so380167wra for ; Thu, 17 Feb 2005 20:32:12 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=cqGc7R5icXFyVb3+qmgbSsexexW+SuivBRSnolNEYK+sO7O+i4juotckjKtYXnZX5/f1TU75kOQKBph32tBXEwCnCdF/vqEetn9j7nsn+MWRdutTlZh1IRy4qCwubRjluMpdUWX2QKyRj+e/WRYwyCZJySow9A+9GRXoHOnlaUw= Received: by 10.54.18.77 with SMTP id 77mr243418wrr; Thu, 17 Feb 2005 20:32:11 -0800 (PST) Received: by 10.54.40.24 with HTTP; Thu, 17 Feb 2005 20:32:08 -0800 (PST) Message-ID: Date: Thu, 17 Feb 2005 22:32:08 -0600 From: Brice Ruth Reply-To: Brice Ruth To: ibatis-user-java@incubator.apache.org Subject: Re: SOAP attachement (pdf) stored into a db field In-Reply-To: <4C9DA13E5023C24BB608AB8B9FEEC18715ACFD@mail2.dminfoed.infoed.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <4C9DA13E5023C24BB608AB8B9FEEC18715ACFD@mail2.dminfoed.infoed.org> X-Virus-Checked: Checked My understanding is that streaming data to a BLOB-type field (which you would likely need to do with a 20MB+ dataset, is still a "coming soon" feature - and I believe it requires the latest version of JDBC (3.0), which may or may not be supported by the SQL Server driver you're using (are you using jTDS?). So, I guess what you're likely need to do is use JDBC for this particular thing ... I'm not certain that even a CustomTypeHandler will do the trick here for you - though it might, its worth a try. On Wed, 16 Feb 2005 08:09:51 -0500, Horgen, Scott wrote: > > > I have a SOAP service that I would like to receive and store both XML based > messages and their corresponding MIME attachments, in particular large, 20+ > MB file sizes directly into a database "image" type field in MS-SQL. I can > easily direct the attachement to a file: > > private void persistToFile(AttachmentPart ap,int partNum, String > persistToDirectory) { > java.io.InputStream content = null; > FileOutputStream fileOutputStream = null; > File attachFile = null; > byte[] buffer = new byte[10000]; > int len ; > > try { > attachFile = new File(persistToDirectory + > "\\NIHReply_" + partNum + "_" + (new Date().getTime()) + ".pdf"); > > fileOutputStream = new FileOutputStream(attachFile); > content = (java.io.InputStream)ap.getContent(); > streamCopy(content, fileOutputStream); > partNum++; > fileOutputStream.close(); > } catch(Exception ex) { > ex.printStackTrace(); > } > } > > Where ap is an AttachmentPart object of type javax.xml.soap.AttachmentPart. > > But, it is unclear how to proceed with this large stream in iBattis, which I > am using just fine in the rest of my webservice. > > Thanks, > > Scott > > _____________________________ > Scott Horgen > Java Architect > > InfoEd International, Inc. > 1873 Western Avenue, Suite 201 > Albany, NY 12203 > Tel: 518-464-0691 > 800-727-6427 > Fax: 518-464-0695 >