Hi all you Servlet gurus!
I am hosting a website which runs purely on Servlet, JSP and JDBC technology, but I've little experience with Servlets accepting and processing input files from the user. Ok. I have no experience of it
I would appreciate any suggestions.
Essentially, I need to accept a simple text file from the client and use it to update their database records. The questions I have are as follows:
1) How best to accept the input file by the simplest means. Can I open an open-file type popup that allows the user to browse and select a text file?
2) How does the Servlet read the file? ie. which API should I use, etc
3) The file simply has two columns per record which require validation. Is a delimiter the best (or at least simplest) way for me to distinguish between the 2 columns?
4) This is my most important question. I'm expecting about 100 to 2000 records per input file, and I can receive many simultaneously from various clients. What is the best way to process this? Each file will hit different records in the database, but I'm still concerned about the performance issue. It is not imperative for the client to wait for a completed-processing response, but
how do I get the Servlet to process the file in the background and allow the client to carry on with other tasks. (I can always update a process-completed flag which will notify the user that their file has been processed the next time they poll their records)
5) Should I be concerned with any synchronization issues?
Thanks a mil for taking the time to read this missive. Any suggestions are much appreciated