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

Reply via email to