How could I save MimeMultipart content of a MimeMessage object into a database and get it back safely.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rohit_Mahajan
Posted On:   Monday, September 17, 2001 08:52 PM

How could I save MimeMultipart content of a MimeMessage object into a database using JDBC and get it back safely. Here MimeMultipart object might contain several bodyparts of different content-types.I am using SQL Server-7 and image type column to store content. I know how to put a binary-stream data into the database but not able to get proper binary stream from the MimeMultipart object since after using MimeMessage.getInputStream() to put data into the database column, I get an exception "Missing start boundary" when I create the new MimeMessage from the ByteArrayDataSource back from the database. Can anybody guide me. If possible send me code at rmahajanmail@yahoo.com .

Thanks in advance...

Re: How could I save MimeMultipart content of a MimeMessage object into a database and get it back safely.

Posted By:   Kahro_Raie  
Posted On:   Wednesday, September 19, 2001 01:56 AM

I send the messages over JMS:


To get the byte array:


ByteArrayOutputStream out = new ByteArrayOutputStream() ;
message.writeTo( out ) ;
byte[] data = out.toByteArray() ;


To get the message back:


InputStream in = new ByteArrayInputStream( data ) ;
MimeMessage mime_message = new MimeMessage( session , in ) ;
About | Sitemap | Contact