Home > OS >  Query Oracle database on local network from Javascript in browser
Query Oracle database on local network from Javascript in browser

Time:03-02

I have a Oracle database server hosting data, and I want to build a small app on my local network for people to do light data entry.

Normally we can't query a database from the browser because the browser is client-side and the database is on the server.

But what if the server and website are both hosted on the local network? Would it then be possible? The problem is I don't have a server I'm just making a small website as a file on a shared drive.

CodePudding user response:

But what if the server and website are both hosted on the local network?

This does not change almost anything, maybe it makes things a bit easier when it comes to application security.

Normally we can't query a database from the browser because the browser is client-side and the database is on the server.

That's not true. You can query a database from a browser/client-side. The problem behind such a solution is security of course, because in this case the client would have to know the database credentials, which is why such operations are performed on the server side, but it does not mean that querying database from client-side is not possible.

The conclusion is that if you know the database credentials anyway, it is possible to write a simple application (which will query database from client-side) for yourself. For this you can use OracleDB module.

---EDIT---

I will only emphasize once again that you should not make such an application available anywhere outside for security reasons (availability of database credentials).

However, you can use JavaScript fullstack frameworks like nextjs or sveltekit - they are able to perform some server-side operations and then pass this data to the client. This approach would be much safer.

CodePudding user response:

I'd use Oracle Application Express.

It is installed in Oracle database; lets you develop applications rather quickly (if you know some SQL; even if you don't - use wizards). The only "tool" you need is a web browser. Your users would also need it (the browser), accessing your application via local network and enjoy beautiful application you'll create.

  • Related