Trying to connect a PostgreSQL database to Eclipse
This line shows the problem:

Caused by: java.net.SocketTimeoutException: connect timed out


As a rule of thumb, typically in Java stacktraces, the first "Caused by" (printed last) is what you want.

Your Win10 can't connect to the postgresql on your CentOS. PostgreSQL uses typically the TCP port 5432.

It gets a connection timeout error, which means your win10 absolutely doesn't get an answer. Nothing. If your postgresql wouldn't allow the connection, or if your postgresql wouldn't listen on your tcp port 5432, you had got "authentication error" or "connection refused" error.

But your win10 doesn't get anything, not even an error. As if your server wouldn't even exist.

You can check the availability of your postgresql with a

telnet your.centos.ip 5432


command.

The most probably cause of your problem is that the default firewall configuration of your centos simply filters out the 5432 port. Enable it.

The second most probable cause is that you simply typed in a false IP.

If you solved that problem, then


your telnet command won't hang up
your java software will connect, or at least it will have a different error (authentication error or connection refused are the most likely).


Making postgresql listening on the network requires also some different settings, beside your firewall configuration:


You have to set up your postgresql to listen on all IP addresses, not only on localhost. This can be done with a listen_addresses line of your postgresql.conf.
You have to set up some authentication (md5 password is the most likely) in the pg_hba.conf.


First connect your postgresql with some client, for example with pgadmin or with the command line psql tool (it comes also with cygwin). After it works, only then play to connect it from Java.