How to connect to Database Server on another machine ?

Hi Guys, The Database server is on another PC (Linux is the OS installed on it) whose IP address is :- 10.0.2.21 and my machine's (Windows XP) IP address is :- 10.0.2.253 . So how do i connecet using JDBC?

Now both these PCs ( ...i.e., my client PC and the PC on which the postgres Database Server 8.1 is hosted ) are in one network, and the external IP address of this entire network is :- 59.163.23.73 So if i want to access the database using JDBC from a PC external to this network ( ...i.e., 59.163.23.73 ) then how do i do it ?