I would like to make a server (A) in Java. Some clients (B) connect to A and send informations. When (A) receives data from (B) it must store those information into a PostgreSQL server (C).
I want to know how can I manage the connection between (A) and (C). I have two ideas:
1) Create an initial connection from (A) to (B). This connection remains always active. 2) Create a connection between (A) and (B) every time (A) receive a connection from (B), then close the connection (open/close a connection to the db from every client connect to the server)
My worry is about the database timeout.
Thank you