pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mateusz Mazur <vincent@waw.pdi.net>
To: pgsql-sql@postgresql.org
Subject: Great thanks (JDBC). Another probem.
Date: Wed, 13 Dec 2000 12:45:55 +0100
Message-ID: <3.0.6.32.20001213124555.00797100@waw.pdi.net> (raw)

Hello.

Thank you for your answer (really big thanks). But I have another problem.
I try to connect to my linux postgresql server and I have some error. I
have linux machine on my local network (e.g. 192.168.1.100), on this
machine I have postgresql 7.0.2. In my "pg_hba.conf" file is line like that:
host	all	0.0.0.0		0.0.0.0		password
so I think I could connect to psql from all network. I write Java class on
second computer (w2k) but in the same network (e.g. 192.168.1.101). The
code looks like that:

"
import java.sql.*;

class Javasql
{
	public static void main(String[] args)
	{
		try 
		{
		Class.forName("org.postgresql.Driver");			
    		Connection db =
DriverManager.getConnection("jdbc:postgresql://192.168.1.100/menu","javaus",
"testpwd");
		}

		catch(Exception e)
		{
			System.out.println("Exception !!!");
		}	
	System.out.println("After Exception");
	}
}
"

where:
javaus – user in pg_shadow
menu – database
testpwd – correct password for javaus

Problem is that I can’t connect to server. Appear exception. Exception is
caused by getConnection() method not Class.for.Name(). I try also write
line like that 
DriverManager.getConnection("jdbc:postgresql://192.168.1.100:5432/menu","jav
aus”,"testpwd");
The same problem. Postgres looks fine, because he accept connection from
php script (localhost). I can't test Java localhost connection (ther is no
sDK or JVM on linux machine).

I don't know I do wrong.
If any one can help me. Please.

Mateusz.





Message-ID: <3.0.6.32.20001213124555.00797100@waw.pdi.net>
Permalink:  ../3.0.6.32.20001213124555.00797100@waw.pdi.net/
Also on:    postgresql.org/message-id/3.0.6.32.20001213124555.00797100@waw.pdi.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: vincent@waw.pdi.net
  Subject: Re: Great thanks (JDBC). Another probem.
  In-Reply-To: <3.0.6.32.20001213124555.00797100@waw.pdi.net>
  References: <3.0.6.32.20001213124555.00797100@waw.pdi.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox