Lebowski156
Lebowski156

Reputation: 951

Database + Java Servlet: how to run database?

For a project, I am creating a small website that uses login functionality and has a database to store user info.

I'm wondering if it is possible to simply create a database, put it in a directory with all of my other website files, and then send that folder to someone so that when they open the folder, they will be able to use the website, and all of the login functionality.

I know how to run a postgres database on my localhost, but I don't understand how I can send the folder to someone else because they obviously wont have access to the database on my local host.

Thanks

Upvotes: 0

Views: 92

Answers (1)

niculare
niculare

Reputation: 3687

A database must run on a server, it is not just a regular file which you read and write. If you want somebody else to access your database you can generate a script which will create the database from scratch and send that script. The receiver will run the script and will have the database created on his running instance of server.

The second option would be to connect directly to your server through internet. You must have a public IP (known by who connects) and the firewall configured appropriately.

Upvotes: 1

Related Questions