JDBC fails while used from remote machine...

Поиск
Список
Период
Сортировка
От Zhou, Lixin
Тема JDBC fails while used from remote machine...
Дата
Msg-id 7711BB513213D4118E3700B0D0220F7902C0E5@ILLUMINA4
обсуждение исходный текст
Список pgsql-general

Hello,

From Windows NT, I have a problem to connect to my PostgreSQL 6.5.2 server
running on an i386-based Linux, Red Hat 6.1, using JDBC.  The java class I
used for testing was from the src/interfaces/jdbc/example/basic.java.

First of all, I know postmater runs with -i turned on.  The standard
port number was used.

Secondly, I have $PGDAT/pg_hba.conf set up to allow everyone from my subnet
to connect to the server.

# pg_hba.conf
host         all         192.168.50.158  255.255.255.255   trust
host         all         192.168.50.0  255.255.255.0   trust

Everything runs okay on Linux machine using JDK1.1.8.

I copied the jdbc6.5-1.2.jar to my NT machine.  While I run the "basic",
it failed.  Jdk1.2 was used on the NT.

What's the problem?

Lixin
lzhou@illumina.com



==============================================
I ran from 192.168.50.61 (Linux, Red Hat 6.1), and it worked.

Here is the log.
==============================================

Script started on Wed May  3 16:41:02 2000
6$ java basic jdbc:postgresql://192.168.50.61:5432/lixinz lixinz ""
PostgreSQL basic test v6.3 rev 1

Connecting to Database URL = jdbc:postgresql://192.168.50.61:5432/lixinz
Connected...Now creating a statement

Running tests:
Updated 3 rows
performing a query
  a=1 b=8
  a=2 b=8
  a=3 b=8
  a=4 b=2
  a=4 b=3
  a=4 b=4
performing another query
  a=1 b=8
  a=2 b=8
  a=3 b=8
  a=4 b=2
  a=4 b=3
  a=4 b=4
Now closing the connection
6$ exit
Script done on Wed May  3 16:48:26 2000

========================
When I ran the same thing from the MS NT machine with the IP
192.168.50.158, and it failed.

Here is the error message I got.
========================

E:\postgres>c:\jdk1.2.2\bin\java -cp .;jdbc6.5-1.2.jar basic jdbc:postgresql://1
92.168.50.61:5432/lixinz lixinz ""
Exception caught.
The connection attempt failed because java.net.SocketException: setsockopt() TCP
_NODELAY (code=10055)
The connection attempt failed because java.net.SocketException: setsockopt() TCP
_NODELAY (code=10055)
        at postgresql.Connection.openConnection(Connection.java, Compiled Code)
        at postgresql.Driver.connect(Driver.java:116)
        at java.sql.DriverManager.getConnection(DriverManager.java:457)
        at java.sql.DriverManager.getConnection(DriverManager.java:137)
        at basic.<init>(basic.java:23)
        at basic.main(basic.java:162)

when this happens, the server says "port reset by peer... or something
like that..."

 

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: RE: One last thing... psql and readline
Следующее
От: Elijah Roberts
Дата:
Сообщение: lo_tell problem with JDBC and RC4