Re: How to hide JDBC connection credentials from git?

From: Szymon Lipiński <mabewlun(at)gmail(dot)com>
To: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to hide JDBC connection credentials from git?
Date: 2016-05-31 10:33:08
Message-ID: CAFjNrYsdLjWUG7ksKu_9vVHg6q5OXWRQ_s9sV-vBO6d30_a73Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 31 May 2016 at 11:32, Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
wrote:

> Hello,
>
> I work on several small Java projects (using Maven+NetBeans) and store
> them in a public git repository.
>
> I would like to use PostgreSQL JDBC in some of the projects, but don't
> want to make the connection credentials of my database public.
>
> Surely there are other developers out there, who have already faced
> similar problem.
>
> Please share your solutions.
>
> It is probably possible to put the database name/user/password into a
> *.properties file and then ignore it in git repository, but keep it in the
> workarea?
>
> Thank you
> Alex
>
>
Usually I use either a separate config file, or environment variables
wrapped into a separate runner file. The properties file you mentioned is
quite a good idea.
Just remember to provide a template file, so other programmers could create
their own properties file without debugging the application. And document
how I should make my own properties file, and run the app.

--
regards Szymon Lipiński

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nikhil 2016-05-31 10:39:22 Re: BDR to ignore table exists error
Previous Message Alexander Farber 2016-05-31 09:32:20 How to hide JDBC connection credentials from git?