remote connection with JDBC - Mailing list pgsql-jdbc

From Tony Smith
Subject remote connection with JDBC
Date
Msg-id 20041121173000.77040.qmail@web41604.mail.yahoo.com
Whole thread Raw
Responses Re: remote connection with JDBC
List pgsql-jdbc
Hi,
 
I am trying to connect postgresql database from a remote pc. Here is my code:
 
   Class.forName("org.postgresql.Driver");
   Connection conn = DriverManager.getConnection("jdbc:postgresql://machine.mylbl.gov:5432/mydatabase", "username", "passwd");
 
But I always get the following exception:
 

org.postgresql.util.PSQLException: The connection attempt failed.

Exception: java.io.EOFException

Stack Trace:

java.io.EOFException

at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:244)

at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:222)

at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:94)

at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:65)

at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:106)

at org.postgresql.jdbc2.Jdbc2Connection.<init>(Jdbc2Connection.java:15)

at org.postgresql.Driver.connect(Driver.java:140)

at java.sql.DriverManager.getConnection(DriverManager.java:538)

at java.sql.DriverManager.getConnection(DriverManager.java:188)

at Test.main(Test.java:29)

End of Stack Trace

at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:119)

at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:65)

at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:106)

at org.postgresql.jdbc2.Jdbc2Connection.<init>(Jdbc2Connection.java:15)

at org.postgresql.Driver.connect(Driver.java:140)

at java.sql.DriverManager.getConnection(DriverManager.java:538)

at java.sql.DriverManager.getConnection(DriverManager.java:188)

at Test.main(Test.java:29)

 

Why:

 

Thanks,


Tony

 


Do you Yahoo!?
Discover all that�s new in My Yahoo!

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: Strange server error with current 8.0beta driver
Next
From: Kris Jurka
Date:
Subject: Re: remote connection with JDBC