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 <[EMAIL PROTECTED]> 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
>