You did not specify a version, so I am assuming oracle81 here. In Oracle8i and previous, you cannot directly insert a blob. You must do the insert minus the blob data (using an empty lob), then select the blob column for update.
Typically this involves: 1) Insert using setBlob(oracle.sql.BLOB.empty_lob()) 2) Update using oracle.sql.BLOB.putBytes() or oracle.sql.BLOB.getBinaryOutputStream() The setBinaryStream() approach you mention is allowed but very restricted in Oracle and in general is only safe if you are using the OCI driver. Check out the oracle docs for more info. HTH -----Original Message----- From: Claire Wall [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 23, 2003 8:44 AM To: Struts Users Mailing List Subject: converting a FormFile to a Blob object hi, I have a jsp page which uploads a file to a database. I have no problems storing the file in an SQLServer or MySQL database by using the setBinaryStream() method of a PreparedStatement. The file gets upload no problem. However, when I try to upload this file to an oracle database (BLOB column) it does not work. I'm sure that i have to use the setBlob() method of the PreparedStatement, however, my dilemma is that I cannot find a way to convert my file from FormFile format to sql Blob format. Does anybody know how to do this as I've looked everywhere and haven't come up with a solution. Any help would be much appreciated thanks claire --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

