• Post Reply Bookmark Topic Watch Topic
  • New Topic

Uploading Flat file in the database

 
Mark Henryson
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am doing one project in Sevlet with JSP. Oracle 9i is the database and I am using JRUN 4.0 Server in Windows 2000 Professional.

What I am trying to do is, uploading a text file(may be notepad or textpad) that contains the record. I have written the code in servlet an jsp for reading the records in the flat file and do the validation and upload it in the database.

For Example I want to do the bulk upload of 10,000 - 25,000 records, at that time I am facing the problem.

I will give the example scenerio: I want to upload the below flat file:

UploadForCustomer.txt
----------------------
#FORMAT
#Customer ID | Customer Name | Customer Age | Customer Address

11111111111 | aaaaaaaaaaaaa | 12 | aaaaaaaaaaaaaaaa
11111111111 | aaaaaaaaaaaaa | 12 | aaaaaaaaaaaaaaaa
11111111111 | aaaaaaaaaaaaa | 12 | aaaaaaaaaaaaaaaa
.
.
.
.

Above is the example file I am trying to upload in the database thru' servlets and jsp.

If I am having more than 10,000 - 25,000, It's telling connection timed out, reacuire the connection. How to fine tune this problem.

Is there any way in JAVA (Sevlet) to upload in an efficient way without having the connection problem.

Another question: For what MultiPartRequest is used.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mark Henryson:
If I am having more than 10,000 - 25,000, It's telling connection timed out, reacuire the connection. How to fine tune this problem.

Is there any way in JAVA (Sevlet) to upload in an efficient way without having the connection problem.


Try to use API linked below. If problem persist, feel free to continue the discussion in the same thread.

Originally posted by Mark Henryson:
For what MultiPartRequest is used.


Multipart request is used for the data other than string/text. For example to upload files and images like stuff.

The way we get the value/data from form fields, in multipart requests, is also differ from normal requests. We need to write a seperate algorithm to deal with these requests. But fortunately, we have some very good tested and widely used third party API to overcome this hurdle. See JSP Faqs File Upload.

Thanks.
 
NageshKumar Pulavarthi
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This problem raises when you have less memory cache for you server.please let me know which server you are using.I Suggest three solutions for this.
1) Try to icrease the cache of your server.
2) Try to read 10 records at a time and write into database at once.
3) If both above things fail then it is better to write a PL/SQL procedure in the database and call that procedure by passing the file name.

I hope these tips helps you.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!