Upload 786 bytes Data of csv file(atucally 1 milion file) via GUI and call the rest ful and stored the data in database

1. Upload csv file(1 milion records) via GUI(angular js)
2. calling the rest ful service
rest code:(cxf, apache)
1. taking the data from the filelocation and writing into server
2. then read the data via buffer reader, reading is done by line by line
3. then call the dao layer and stored the data into oracle sql Database via datasource(weblogic)

Need to find the time and cost for the following?

1 upload file and store on the server
2. read file line by line
3. read file line by line, parse each line.
4. read file line by line, parse each line, and insert into db

 long start = System.nanoTime();
long end = System.nanoTime();
 long used = end-start;
 System.out.println("used:"+TimeUnit.NANOSECONDS.toMillis(used)+" ms");

I used above code to find the  time and cost with different variables.
For read line by line and parse each line.. for those i am getting 0ms all the time

I tested with the sample file(786 bytes). so that i can look into the stack trace.(to know the upload file that is store on server)

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

narcist527Author Commented:
please any help is highly appreciated. thanks
Geert GOracle dbaCommented:
Your question is very cryptic
I think you want to know why you are getting 0ms for the time.  Try and just print the value in ns.  

When you are reading, parsing, and inserting into a DB are you doing this function on the client where the javascript is running, or are you doing this on the server.

If you are performing those functions on the server and you are doing the timing on the client it possible you are only timing how long it take to upload the 768 bytes of data.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
narcist527Author Commented:
Yes, I am getting 0 bcz i am converting nano to the milliseconds.. i tried giving  just nano.. and it is working fine...

the function i am doing is on server side...

0.04 mins time to upload 768 bytes... for 1milion data  it is taking 6 hours time to upload..

taking more time to insert to into database....

Now, java's work is to upload file via UI and stored in the network.. ==> Implies success if the data processed in the network.. then another app is gng to dumb in database..

For this implementation, how do i place the file  in the network based on different env? like local,  dev, prod etc..?
 relative path ? please guide me..

finally, thanks for the response. you are awesome.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.