Sorry, I forgot put the exception in my message... - Mailing list pgsql-general

From Javier Benito
Subject Sorry, I forgot put the exception in my message...
Date
Msg-id 38FD7C7E.2C85F199@innosec.es
Whole thread Raw
Responses Re: Sorry, I forgot put the exception in my message...  (Tom Cook <tcook@lisa.com.au>)
List pgsql-general
Well, my problem isn't with the JDBC driver. I still haven't learnt to
use it. I'm doing now. The initial exception, when i was trying to
connect in such a way:

                String url = "jdbc:postgresql:BDPrueba";

                Connection con = DriverManager.getConnection(url,"","");

was:

Connection refused. Check that the hostname and port is correct, and
that the po
stmaster is running with the -i flag, which enables TCP/IP networking.
        at java.lang.Throwable.<init>(Compiled Code)
        at java.lang.Exception.<init>(Compiled Code)
        at java.sql.SQLException.<init>(Compiled Code)
        at postgresql.util.PSQLException.<init>(Compiled Code)
        at postgresql.Connection.openConnection(Compiled Code)
        at postgresql.Driver.connect(Compiled Code)
        at java.sql.DriverManager.getConnection(Compiled Code)
        at java.sql.DriverManager.getConnection(Compiled Code)
        at prueba.main(Compiled Code)

and when I'm trying to connect in this way:

               String url = "jdbc:postgresql:BDPrueba";

            Connection con = DriverManager.getConnection(url,"","");

my problem is:

Unknown object of type:java.lang.NullPointerException
java.lang.IllegalArgumentException: Unknown argument
        at java.lang.Throwable.<init>(Compiled Code)
        at java.lang.Exception.<init>(Compiled Code)
        at java.lang.RuntimeException.<init>(Compiled Code)
        at java.lang.IllegalArgumentException.<init>(Compiled Code)
        at java.text.MessageFormat.format(Compiled Code)
        at java.text.MessageFormat.format(Compiled Code)
        at java.text.MessageFormat.format(Compiled Code)
        at postgresql.util.PSQLException.translate(Compiled Code)
        at postgresql.util.PSQLException.<init>(Compiled Code)
        at postgresql.Driver.connect(Compiled Code)
        at java.sql.DriverManager.getConnection(Compiled Code)
        at java.sql.DriverManager.getConnection(Compiled Code)
        at prueba.main(Compiled Code)

I've checked that postmaster is running in Solaris 5.6 with -i option. I
think the problem may be that i'm not defining users, but in the
pg_hba.conf file the defaults are that anyone in anywhere can connects
to any database.
What can i do?

Thanks for thinking a little time in this question.
Javi.

Attachment

pgsql-general by date:

Previous
From: "Manuel Lemos"
Date:
Subject: Re: Connecting website with SQL-database.....
Next
From: Ed Loehr
Date:
Subject: Re: On functions and stored procs