File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Postgres and Firewall Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Postgres and Firewall" Watch "Postgres and Firewall" New topic

Postgres and Firewall

Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3640
We have Postgress Database running on machine with ip address on port no 5432.

We want to access this database from outside the firewall. Hence we need to open port no 5432 of 192.168.01 in firewall for outside users. But in firewall configuration we need to provide the type of call also like https, https, ect.

We have Swing based application that need to access database over internet.

Please guild me, what kind of call it will be from Swing based application to database?

My blood is tested +ve for Java.
JavaRanch feeder

Joined: Dec 22, 2006
Posts: 3
Jdbc uses TCP protocol for communicating with the database. So in the firewall you need to mention the destination IP and also the protocol which in this case is TCP. Also if you want to restrict it based on a particular external IP then you need to mention that in postgres.conf file (listen_addresses).
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3640
Thanks for your reply.
I agree. Here's the link:
subject: Postgres and Firewall
It's not a secret anymore!