0

I have an excel sheet, a JS application and a db. excel sheet has data. I need to open the file and read data from the JS application and insert it into the db(say oracle db). How to?

I think we cannot open and close file in JS, pls correct me if i am wrong since it poses a security issue. If that is the case, say if we have updated the data in the grid, or table in the JS application. and we want to insert all the data in to the db, how do we do it?

asked Jan 29, 2015 at 7:50
2
  • Depends on in which environment the application is running and what the capabilities of the DB are. Commented Jan 29, 2015 at 7:52
  • JavaScript run on a browser which has a very strict security restrictions. And keeping any connection string on JavaScript is not a good practice at all . Don't keep any sensitive things on client side. Make a call to server side validate and work on that. Commented Jan 29, 2015 at 7:52

3 Answers 3

1

First- there is pretty good module to read/write excel files in javascript-client or javascript-server:

js-xlsx

Someone has used it and provided a blog on its usage here

Second- You have to involve one more tier (server) to get the work done as per security standards. Or another option is BaaS (Back-end-as-Service) like Parse, Firebase to serve your client as database, it lets you directly save your stuff without involving/writing server. Or other option is to use SaaS like Mongolab, it exposes api for client to directly save into db.

Happy Helping!

answered Jan 29, 2015 at 8:37
Sign up to request clarification or add additional context in comments.

Comments

0

You cannot do this safely. You need a webservice that the javascript app can call and that service would write to the database. So you should build a restful web api.

answered Jan 29, 2015 at 7:54

Comments

0

You need a Proxy Service for interacting to DB. There is no db-connectors for JS. The simplest way to achieve your goal is to choose one of the scripting languages which can run on your server. Such as PHP, Python, ASP.NET, ASP etc. I suggest PHP or Python.

answered Jan 29, 2015 at 8:24

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.