Great thanks (JDBC). Another probem.

Поиск
Список
Период
Сортировка
От Mateusz Mazur
Тема Great thanks (JDBC). Another probem.
Дата
Msg-id 3.0.6.32.20001213124555.00797100@waw.pdi.net
обсуждение исходный текст
Список pgsql-sql
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");
Connectiondb =
 
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.




В списке pgsql-sql по дате отправления:

Предыдущее
От: bboett@erm1.u-strasbg.fr (Bruno Boettcher)
Дата:
Сообщение: Postgres closing the connection too fast with php4+apache
Следующее
От: "Daniel Hentges"
Дата:
Сообщение: Date Format