You can use the setBinaryStream() of PreparedStatement.
If you have a table with two name (of type varchar2) and data (of type BLOB),
then you can use the following code sample,

    ...........

   Connection con = .........;

try {

PreparedStatement pst = con.prepareStatement("insert into mytable values(?,
?)");
String str = "mydata1";
pst.setString(1, str);

String filename = ..............;  //path of the file
File imagefile = new File(filename);
InputStream is = new FileInputStream(file);

pst.setBinaryStream(2, is, (int) file.length());

pst.executeUpdate();

}
catch (SQLException se) { .......... }
catch(Exception e)  { ........... }

}

.........

..........



"Suon, Thla" wrote:

> Hello Everyone,
>
> Can you please help me out there?  I am having problem of how to insert a
> large volume of
> Informations, whether it be asciis, screenshots, images into a table that is
> of BLOB
> datatype.  If anyone has code samples of ideas of how to implement this,
> please
> let me know.  I would greatly appreciate your help.
>
> Thank you,
> Thla ("Tyla")
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to