pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
remote connection with JDBC
4+ messages / 2 participants
[nested] [flat]

* remote connection with JDBC
@ 2004-11-21 17:30  Tony Smith <quickome@yahoo.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Tony Smith @ 2004-11-21 17:30 UTC (permalink / raw)
  To: 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!

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: remote connection with JDBC
@ 2004-11-21 20:29  Kris Jurka <books@ejurka.com>
  parent: Tony Smith <quickome@yahoo.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Kris Jurka @ 2004-11-21 20:29 UTC (permalink / raw)
  To: Tony Smith <quickome@yahoo.com>; +Cc: pgsql-jdbc



On Sun, 21 Nov 2004, Tony Smith wrote:

> java.io.EOFException
> at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:244)
> at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:222)

You should check in your server log file to see if it has anything 
interesting to say about this failure.  What authentication method are you 
using (md5/crypt/password/...)?  The driver shouldn't be bailing out with 
an error like that, but it is unclear where the actual problem is.  The 
stacktrace line numbers don't match up with the current source, so it 
would be helpful if you downloaded the lastest version of the driver.  

http://jdbc.postgresql.org/download.html#jars

Kris Jurka



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: remote connection with JDBC
@ 2004-11-22 04:55  Tony Smith <quickome@yahoo.com>
  parent: Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Tony Smith @ 2004-11-22 04:55 UTC (permalink / raw)
  To: pgsql-jdbc

Hi:
 
Thank you for your email. I downloaded the new jar file and still got the same exception. 
The error location is now different.
 

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

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

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

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

at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)

at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)

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

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

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

at Test.main(Test.java:29)

Caused by: java.io.EOFException

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

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

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

... 8 more



Kris Jurka <books@ejurka.com> wrote:


On Sun, 21 Nov 2004, Tony Smith wrote:

> java.io.EOFException
> at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:244)
> at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:222)

You should check in your server log file to see if it has anything 
interesting to say about this failure. What authentication method are you 
using (md5/crypt/password/...)? The driver shouldn't be bailing out with 
an error like that, but it is unclear where the actual problem is. The 
stacktrace line numbers don't match up with the current source, so it 
would be helpful if you downloaded the lastest version of the driver. 

http://jdbc.postgresql.org/download.html#jars

Kris Jurka

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

			
---------------------------------
Do you Yahoo!?
 The all-new My Yahoo! – Get yours free!    

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: remote connection with JDBC
@ 2004-11-22 05:42  Kris Jurka <books@ejurka.com>
  parent: Tony Smith <quickome@yahoo.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Kris Jurka @ 2004-11-22 05:42 UTC (permalink / raw)
  To: Tony Smith <quickome@yahoo.com>; +Cc: pgsql-jdbc



On Sun, 21 Nov 2004, Tony Smith wrote:

>  Thank you for your email. I downloaded the new jar file and still got
> the same exception.  The error location is now different.
>  

This unfortunately doesn't tell what the real problem is.  Please check 
your server log file to determine what's happening on the server side 
of the connection.  Also you did not include what authentication method 
you were using (or server version) to help narrow down the problem.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2004-11-22 05:42 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-11-21 17:30 remote connection with JDBC Tony Smith <quickome@yahoo.com>
2004-11-21 20:29 ` Kris Jurka <books@ejurka.com>
2004-11-22 04:55   ` Tony Smith <quickome@yahoo.com>
2004-11-22 05:42     ` Kris Jurka <books@ejurka.com>

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