Hi,
I am working on upload into and download from database. I am using
jspsmartupload api.
Please help me any one worked on this api.. I am getting an error like
An error occurs : java.sql.SQLException: Internal Error: Unable to construct
a Datum from the specified input 0 file(s) uploaded in the database
When the file size is less then 4KB.. and I am getting an error like this
when the file size is grater then 4KB I am getting an error like this..
An error occurs : java.sql.SQLException: ORA-01008: not all variables bound
When I was trying to insert a row into database by using result set by using
rs.moveToInsertRow();
rs.insertRow();
I am getting another error like
java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in
socke
t input stream read
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java)
at
oracle.jdbc.driver.OracleResultSetImpl.internal_close(OracleResultSet
Impl.java)
at
oracle.jdbc.driver.OracleResultSetImpl.close(OracleResultSetImpl.java
)
at
oracle.jdbc.driver.ScrollableResultSet.close(ScrollableResultSet.java
)
at
oracle.jdbc.driver.UpdatableResultSet.close(UpdatableResultSet.java)
at
examples.jsp.smart.sample4_jsp_1._jspService(sample4_jsp_1.java:166)
at com.sun.jsp.runtime.HttpJspBase.service(HttpJspBase.java:87)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
at
com.sun.jsp.runtime.JspServlet$JspServletWrapper.service(JspServlet.j
ava:88)
at
com.sun.jsp.runtime.JspServlet.serviceJspFile(JspServlet.java:218)
at com.sun.jsp.runtime.JspServlet.service(JspServlet.java:294)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
at
com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.java:155
)
at com.sun.web.core.Context.handleRequest(Context.java:414)
at
com.sun.web.server.ConnectionHandler.run(ConnectionHandler.java:139)
HANDLER THREAD PROBLEM: java.io.IOException: Socket Closed
java.io.IOException: Socket Closed
at java.net.PlainSocketImpl.getInputStream(Unknown Source)
at java.net.Socket$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.Socket.getInputStream(Unknown Source)
at
com.sun.web.server.ConnectionHandler.run(ConnectionHandler.java:161)
Please help me in this, I will thankful to u.
Thanks,
malla Reddy
Here is the code..
ResultSet rs = stmt.executeQuery("SELECT Ta.* FROM MP1.TBL_UPLOAD Ta where
ID =1");
// if the resultset is not null
if (rs.next()){
// Initialization
mySmartUpload.initialize(pageContext);
// Upload
mySmartUpload.upload();
// upload file in the DB if this file is not missing
if (!mySmartUpload.getFiles().getFile(0).isMissing()){
try {
//rs.moveToInsertRow();
//rs.updateInt("ID",2);
rs.updateString("FILENAME",
mySmartUpload.getFiles().getFile(0).getFileName());
// Add the current file in the DB field
System.out.println("I am before update Row()" +
mySmartUpload.getFiles().getFile(0).getFileName());
mySmartUpload.getFiles().getFile(0).fileToField(rs,"ATTACHMENT");
System.out.println("I am before update Row()");
// Update
//rs.insertRow();
//rs.first();
rs.updateRow();
count++;
} catch(Exception e) {
out.println("An error occurs : " + e.toString());
}
}
}
// Display the number of files uploaded
out.println(count + " file(s) uploaded in the database.");
rs.close();
stmt.close();
con.close();
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
===========================================================================
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