Hi All,
The PageByPage Iterator problem has been solved.
Thanks for ur concerns. But one more question now.
I wanna give the feature of File Upload on my site.
I have been trying different components available on net but
some of them offer Upload but not the Download component.
The problem with the jspSmartUpload component is that the sample4
it has provided for direct insertion of the File into a Database filed has the
following code.
<%@ page language="java" import="java.sql.*,com.jspsmart.upload.*"%>
<jsp:useBean id="mySmartUpload" scope="page" class="com.jspsmart.upload.SmartUpload" />
<HTML>
<BODY BGCOLOR="white">
<H1>jspSmartUpload : Sample 4</H1>
<HR>
<%
// Variables
int count=0;
// Connect to the database
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
Connection con = DriverManager.getConnection
("jdbc:oracle:thin:@jamshed:1521:ORCL","Scott", "tiger");
// SQL Request
Statement stmt = con.createStatement(ResultSet.TYPE_FORWARD_ONLY
,ResultSet.CONCUR_UPDATABLE);
ResultSet rs = stmt.executeQuery("SELECT * FROM TASK_FILES WHERE TFILES=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.updateString("FILENAME",mySmartUpload.getFiles().getFile(0).getFileName());
// Add the current file in the DB field
mySmartUpload.getFiles().getFile(0).fileToField(rs,"FILE");
// Update
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();
%>
</BODY>
</HTML>
Can anybuddy explain whats going in here?
Regards,
Jamshed Siddiqui
---------------------------------
Do You Yahoo!?
Sign-up for Video Highlights of 2002 FIFA World Cup
===========================================================================
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://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com