Hi Zapa,

I am going off the top of my head here, so I might be wrong, but...

You probably don't want to cast the bytes of the input stream directly into a BLOB. 
What you probably want is your PDF field on your entity bean to be of type "byte[]".

A BLOB is essentially just a byte array. So lets say your entity bean has methods:

public abstract byte[] getPDF();
public abstract void setPDF(byte[]):

you can do something like this with your input stream from your JSP:

ByteArrayOutputStream pdfBytes = new ByteArrayOutputStream();

int current = -1;
while ( (current = myJspPdfInputStreamDealy.read()) != -1 ){
        pdfBytes.write( current );
}

myEntityBean.setPDF( pdfBytes.toByteArray() );


That code is not checked, and is just off the top of my head, but it should be pretty 
close to what you want. You might want to buffer the reader instead of reading one 
byte at a time, but hopefully that helps.

<a 
href="http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3825084#3825084";>View 
the original post</a>

<a 
href="http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3825084>Reply 
to the post</a>


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to