From: | Mateusz Mazur <vincent(at)waw(dot)pdi(dot)net> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Great thanks (JDBC). Another probem. |
Date: | 2000-12-13 11:45:55 |
Message-ID: | 3.0.6.32.20001213124555.00797100@waw.pdi.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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");
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 cant 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.
From | Date | Subject | |
---|---|---|---|
Next Message | Francis Solomon | 2000-12-13 13:45:30 | RE: Date Format |
Previous Message | Daniel Hentges | 2000-12-13 10:51:28 | Date Format |