I am assuming you are using either a BLOB or CLOB in oracle. In which case a LOB
object is really just a pointer to some other
object (in 90% of the cases). Anyway try inserting into tfile a value of EMPTY_BLOB()
or EMPTY_CLOB(). This will store a locator
for your object and then on the following select you can retrive the LOB locator and
write to it.
Check out http://technet.oracle.com they have some examples with working with BLOBs
also look in your ORACLE_HOME/jdbc directory as
there are some examples there thay may help you. Note I don't think writing code to
work with Oracle is Database independant when
it comes dealing with LOB's. At least I have not been able to get it to work without
using the ORACLE classes.
HTH
Scott.
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Dwi Nugroho
Sent: Wednesday, September 26, 2001 4:01 AM
To: [EMAIL PROTECTED]
Subject: jspsmartupload
I have try jspsmartupload from jspsmart
I made some modification in sampe and create new jsp
It was success to upload a file to MySQL table
but it was failure when I try to upload file to oracle8.1.7 with the same
jsp
the error is
An error occurs : java.sql.SQLException: Invalid operation for read only
resultset: updateBytes 0 file(s) uploaded in the database.
and the statement is
stmt =
con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATAB
LE);
mySmartUpload.initialize(pageContext);
mySmartUpload.upload();
String fn = mySmartUpload.getFiles().getFile(0).getFileName();
stmt.executeUpdate("insert into tfiles (id, filename,THEFILE) values
("+ cnt +",'"+ fn + "', " + "null"+ ") ");
stmt.executeUpdate("commit");
ResultSet rs = stmt.executeQuery("SELECT * FROM TFILES WHERE
ID="+cnt);
if (rs.next()){
if (!mySmartUpload.getFiles().getFile(0).isMissing()){
try {
mySmartUpload.getFiles().getFile(0).fileToField(rs,"THEFILE");
// Update
rs.updateRow();
count++;
} catch(Exception e) {
out.println("An error occurs : " +
e.toString());
}
}
}
Can anybody tell me why it happen ??
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets