ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: SOAP attachement (pdf) stored into a db field
Date Fri, 18 Feb 2005 04:36:30 GMT
Well, iBATIS will support it if the driver does... 

However, I would recommend not mapping such a thing to an object
anyway...it's kind of silly no?

Data that large should be directly streamed to the client, or to disk.
 It shouldn't be left resident in memory.

Cheers,
Clinton


On Thu, 17 Feb 2005 22:32:08 -0600, Brice Ruth <bdruth@gmail.com> wrote:
> 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 <SHorgen@infoed.org> 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
> >
>

Mime
View raw message