Lists: | pgsql-jdbc |
---|
From: | Alex Dovlecel <dovle(at)kbs(dot)twi(dot)tudelft(dot)nl> |
---|---|
To: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | JDBC driver problem ? |
Date: | 2002-11-08 13:34:02 |
Message-ID: | E18A9Gs-0007OS-00@ford.kbs.twi.tudelft.nl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
Hello to all,
This is my first question, so don't be mad if it is gonna be a silly one.
I have a psql account on a psql server that runs psql 7.2.1. I want to
connect to it by using java (jdbc).
I downloaded the JDBC 2.0 driver (pgjdbc2.jar) and I am doing the following:
System.out.println(" + Loading the driver" );
Class.forName( "org.postgresql.Driver" ) ;
System.out.println(" + Creating a connection " );
con = DriverManager.getConnection(
"jdbc:postgresql://myserver:5432/Test",
"myaccount",
"mypasswd" ) ;
Loading the driver works. But can't obtain a connection due to:
Exception: Something unusual has occured to cause the driver to fail. Please
report this exception: Exception: java.sql.SQLException: FATAL 1: Password
authentication failed for user "dovle"
Stack Trace:
java.sql.SQLException: FATAL 1: Password authentication failed for user
"myaccount"
at org.postgresql.Connection.openConnection(Connection.java:178)
at org.postgresql.Driver.connect(Driver.java:149)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at Main.main(Main.java:18)
End of Stack Trace
But the password is correct!!!
What could be wrong ?
What should happen if the postgres does not run with the -i parameter ? Could
this be the wrong thing that happened ?
dovle
From: | Daniel Serodio <daniel(at)checkforte(dot)com(dot)br> |
---|---|
To: | Alex Dovlecel <dovle(at)kbs(dot)twi(dot)tudelft(dot)nl> |
Cc: | PostgreSQL JDBC List <pgsql-jdbc(at)postgresql(dot)org> |
Subject: | Re: JDBC driver problem ? |
Date: | 2002-11-08 14:04:39 |
Message-ID: | 1036764282.24409.23.camel@kelly |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
The "FATAL 1" message comes from the backend (server), so this means
you're able to connect to it at the network level, so it must be running
with -i.
It's probably a problem in the authentication setup of the server.
(pg_hba.conf). I don't know which types of authentication the driver
supports, but we use "trust" for our internal network:
host all 192.168.0.0 255.255.0.0 trust
On Fri, 2002-11-08 at 11:34, Alex Dovlecel wrote:
> Hello to all,
> This is my first question, so don't be mad if it is gonna be a silly one.
>
> I have a psql account on a psql server that runs psql 7.2.1. I want to
> connect to it by using java (jdbc).
>
> I downloaded the JDBC 2.0 driver (pgjdbc2.jar) and I am doing the following:
>
> System.out.println(" + Loading the driver" );
> Class.forName( "org.postgresql.Driver" ) ;
>
> System.out.println(" + Creating a connection " );
> con = DriverManager.getConnection(
> "jdbc:postgresql://myserver:5432/Test",
> "myaccount",
> "mypasswd" ) ;
>
> Loading the driver works. But can't obtain a connection due to:
>
> Exception: Something unusual has occured to cause the driver to fail. Please
> report this exception: Exception: java.sql.SQLException: FATAL 1: Password
> authentication failed for user "dovle"
>
> Stack Trace:
>
> java.sql.SQLException: FATAL 1: Password authentication failed for user
> "myaccount"
>
> at org.postgresql.Connection.openConnection(Connection.java:178)
> at org.postgresql.Driver.connect(Driver.java:149)
> at java.sql.DriverManager.getConnection(DriverManager.java:512)
> at java.sql.DriverManager.getConnection(DriverManager.java:171)
> at Main.main(Main.java:18)
> End of Stack Trace
>
>
> But the password is correct!!!
>
> What could be wrong ?
>
> What should happen if the postgres does not run with the -i parameter ? Could
> this be the wrong thing that happened ?
>
> dovle
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
--
[]'s
Daniel Serodio
From: | Alex Dovlecel <dovle(at)kbs(dot)twi(dot)tudelft(dot)nl> |
---|---|
To: | PostgreSQL JDBC List <pgsql-jdbc(at)postgresql(dot)org> |
Subject: | Re: JDBC driver problem ? |
Date: | 2002-11-08 14:30:32 |
Message-ID: | E18AA9Y-0007Vg-00@ford.kbs.twi.tudelft.nl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
Tx for the answer,
Glad to hear this... but I have no clue about what should I do next
I had tried to use an older driver (7.1 driver, jar called like this:
jdbc7.1-1.2.jar) but gives me the following exception :
Exception: The authentication type 5 is not supported. Check that you have
configured the pg_hba.conf file to include the clients IP address or Subnet,
and that it is using an authentication scheme supported by the driver.
Do you have any sugestions?
Tx,
dovle
> The "FATAL 1" message comes from the backend (server), so this means
> you're able to connect to it at the network level, so it must be running
> with -i.
>
> It's probably a problem in the authentication setup of the server.
> (pg_hba.conf). I don't know which types of authentication the driver
> supports, but we use "trust" for our internal network:
>
> host all 192.168.0.0 255.255.0.0 trust
>
> On Fri, 2002-11-08 at 11:34, Alex Dovlecel wrote:
> > Hello to all,
> > This is my first question, so don't be mad if it is gonna be a silly one.
> >
> > I have a psql account on a psql server that runs psql 7.2.1. I want to
> > connect to it by using java (jdbc).
> >
> > I downloaded the JDBC 2.0 driver (pgjdbc2.jar) and I am doing the
> > following:
> >
> > System.out.println(" + Loading the driver" );
> > Class.forName( "org.postgresql.Driver" ) ;
> >
> > System.out.println(" + Creating a connection " );
> > con = DriverManager.getConnection(
> > "jdbc:postgresql://myserver:5432/Test",
> > "myaccount",
> > "mypasswd" ) ;
> >
> > Loading the driver works. But can't obtain a connection due to:
> >
> > Exception: Something unusual has occured to cause the driver to fail.
> > Please report this exception: Exception: java.sql.SQLException: FATAL 1:
> > Password authentication failed for user "dovle"
> >
> > Stack Trace:
> >
> > java.sql.SQLException: FATAL 1: Password authentication failed for user
> > "myaccount"
> >
> > at org.postgresql.Connection.openConnection(Connection.java:178)
> > at org.postgresql.Driver.connect(Driver.java:149)
> > at java.sql.DriverManager.getConnection(DriverManager.java:512)
> > at java.sql.DriverManager.getConnection(DriverManager.java:171)
> > at Main.main(Main.java:18)
> > End of Stack Trace
> >
> >
> > But the password is correct!!!
> >
> > What could be wrong ?
> >
> > What should happen if the postgres does not run with the -i parameter ?
> > Could this be the wrong thing that happened ?
> >
> > dovle
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 5: Have you checked our extensive FAQ?
> >
> > http://www.postgresql.org/users-lounge/docs/faq.html
From: | Daniel Serodio <daniel(at)checkforte(dot)com(dot)br> |
---|---|
To: | PostgreSQL JDBC List <pgsql-jdbc(at)postgresql(dot)org> |
Subject: | Re: JDBC driver problem ? |
Date: | 2002-11-08 15:58:24 |
Message-ID: | 1036771106.24423.30.camel@kelly |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
Looking at the source code for 7.2.1, which is what I have here, it
looks like the driver supports the 'password', 'crypt', 'md5' and of
course, 'trust' authentication schemes. Try using
DriverManager.setLogStream(System.out) before getting the connection,
the driver should print the auth scheme to System.out.
On Fri, 2002-11-08 at 12:30, Alex Dovlecel wrote:
> Tx for the answer,
> Glad to hear this... but I have no clue about what should I do next
>
> I had tried to use an older driver (7.1 driver, jar called like this:
> jdbc7.1-1.2.jar) but gives me the following exception :
>
> Exception: The authentication type 5 is not supported. Check that you have
> configured the pg_hba.conf file to include the clients IP address or Subnet,
> and that it is using an authentication scheme supported by the driver.
>
> Do you have any sugestions?
>
> Tx,
> dovle
>
>
> > The "FATAL 1" message comes from the backend (server), so this means
> > you're able to connect to it at the network level, so it must be running
> > with -i.
> >
> > It's probably a problem in the authentication setup of the server.
> > (pg_hba.conf). I don't know which types of authentication the driver
> > supports, but we use "trust" for our internal network:
> >
> > host all 192.168.0.0 255.255.0.0 trust
> >
> > On Fri, 2002-11-08 at 11:34, Alex Dovlecel wrote:
> > > Hello to all,
> > > This is my first question, so don't be mad if it is gonna be a silly one.
> > >
> > > I have a psql account on a psql server that runs psql 7.2.1. I want to
> > > connect to it by using java (jdbc).
> > >
> > > I downloaded the JDBC 2.0 driver (pgjdbc2.jar) and I am doing the
> > > following:
> > >
> > > System.out.println(" + Loading the driver" );
> > > Class.forName( "org.postgresql.Driver" ) ;
> > >
> > > System.out.println(" + Creating a connection " );
> > > con = DriverManager.getConnection(
> > > "jdbc:postgresql://myserver:5432/Test",
> > > "myaccount",
> > > "mypasswd" ) ;
> > >
> > > Loading the driver works. But can't obtain a connection due to:
> > >
> > > Exception: Something unusual has occured to cause the driver to fail.
> > > Please report this exception: Exception: java.sql.SQLException: FATAL 1:
> > > Password authentication failed for user "dovle"
> > >
> > > Stack Trace:
> > >
> > > java.sql.SQLException: FATAL 1: Password authentication failed for user
> > > "myaccount"
> > >
> > > at org.postgresql.Connection.openConnection(Connection.java:178)
> > > at org.postgresql.Driver.connect(Driver.java:149)
> > > at java.sql.DriverManager.getConnection(DriverManager.java:512)
> > > at java.sql.DriverManager.getConnection(DriverManager.java:171)
> > > at Main.main(Main.java:18)
> > > End of Stack Trace
> > >
> > >
> > > But the password is correct!!!
> > >
> > > What could be wrong ?
> > >
> > > What should happen if the postgres does not run with the -i parameter ?
> > > Could this be the wrong thing that happened ?
> > >
> > > dovle
--
[]'s
Daniel Serodio