SwimMaster
SwimMaster

Reputation: 381

Starting database on program start

I'm writing a small application that connects to a Postgres database.

Does eclipse or maven support startup scripts that would allow me to check to see if the database is running and start it if not when I start the program? I think it might be bad programming practice since servers would never do this in a production environment however It would really make development much easier to me.

Thank you in advance!

Upvotes: 0

Views: 47

Answers (2)

aksappy
aksappy

Reputation: 3400

A quick answer to your problem would be this plugin. This postgresql-maven-plugin can perform start and stop a postgres server. Suggest you setup a different profile altogether to separate dev and build phases.

Upvotes: 1

I am not answering exactly what you asked, but I want to add a comment. A good way to do this is by using docker and docker-compose as a central tool to manage and start up all services your application need. It works very well.

Upvotes: 0

Related Questions