pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Connection from win95 to postgresql using JDBC and jdk1.2
5+ messages / 3 participants
[nested] [flat]

* Connection from win95 to postgresql using JDBC and jdk1.2
@ 1999-07-23 16:41 Doug Thistlethwaite <doug@dupreeinc.com>
  1999-07-23 17:07 ` Re: [INTERFACES] Connection from win95 to postgresql using JDBC and jdk1.2 Peter Mount <peter@retep.org.uk>
  0 siblings, 1 reply; 5+ messages in thread

From: Doug Thistlethwaite @ 1999-07-23 16:41 UTC (permalink / raw)
  To: pgsql-interfaces; +Cc: doug.t@deltanet.com

Hello,

I know this subject is probably getting old on this list, but I have
still not been able to get my windows 95 system to connect to a linux
2.2.10 kernel system (debian potato) using jdk1.2 on a windows 95
system.  I am trying to get the examples working that came with the JDBC
drivers.   I have downloaded the latest JDBC2 driver from Peter Mount's
web site and I have gotten to the point where I get the following
message:


C:\jdk1.2\DSNBrowse>java example.basic jdbc:postgresql://dragon/doug
doug db
PostgreSQL basic test v6.3 rev 1

Starting constructor for basic
continueing constructor for basic
Connecting to Database URL = jdbc:postgresql://dragon/doug
Exception caught.
Something unusual has occured to cause the driver to fail. Please report
this
exception: java.sql.SQLException: Password authentication failed for
user 'doug'
Something unusual has occured to cause the driver to fail. Please report
this
exception: java.sql.SQLException: Password authentication failed for
user 'doug'
        at postgresql.Driver.connect(Driver.java:112)
        at java.sql.DriverManager.getConnection(Compiled Code)
        at java.sql.DriverManager.getConnection(DriverManager.java:137)
        at example.basic.<init>(basic.java:34)
        at example.basic.main(basic.java:168)

The linux system is connect to the windows 95 system via a small
network.

I have modified the pg_hba.conf file to allow for connections from my PC
using the line

host         doug        207.155.49.102 255.255.255.255  password
/var/postgres/passwd

I tested the connection by using this command on the linux system:

psql -u -h localhost doug

and logged in with the same user name and password I am trying to use on
the PC.  The above psql connection works fine.

Can someone point me in the correct direction on what to look for?  I
think I am pretty close, but I have not been able to get any further in
the last week.

Thank you for your time.

Doug Thistlethwaite





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

* Re: [INTERFACES] Connection from win95 to postgresql using JDBC and jdk1.2
  1999-07-23 16:41 Connection from win95 to postgresql using JDBC and jdk1.2 Doug Thistlethwaite <doug@dupreeinc.com>
@ 1999-07-23 17:07 ` Peter Mount <peter@retep.org.uk>
  1999-07-23 21:13   ` Re: [INTERFACES] Connection from win95 to postgresql using JDBC andjdk1.2 Doug Thistlethwaite <doug@dupreeinc.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Peter Mount @ 1999-07-23 17:07 UTC (permalink / raw)
  To: Doug Thistlethwaite <doug@dupreeinc.com>; +Cc: pgsql-interfaces; doug.t@deltanet.com

On Fri, 23 Jul 1999, Doug Thistlethwaite wrote:

[snip]
> host         doug        207.155.49.102 255.255.255.255  password
> /var/postgres/passwd

Try it without anything after the password keyword, ie

host doug 207.155.49.102 255.255.255.255 password


--
       Peter T Mount peter@retep.org.uk
      Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
 Java PDF Generator: http://www.retep.org.uk/pdf




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

* Re: [INTERFACES] Connection from win95 to postgresql using JDBC andjdk1.2
  1999-07-23 16:41 Connection from win95 to postgresql using JDBC and jdk1.2 Doug Thistlethwaite <doug@dupreeinc.com>
  1999-07-23 17:07 ` Re: [INTERFACES] Connection from win95 to postgresql using JDBC and jdk1.2 Peter Mount <peter@retep.org.uk>
@ 1999-07-23 21:13   ` Doug Thistlethwaite <doug@dupreeinc.com>
  1999-07-24 10:10     ` Re: [INTERFACES] Connection from win95 to postgresql using JDBC andjdk1.2 Peter Mount <peter@retep.org.uk>
  0 siblings, 1 reply; 5+ messages in thread

From: Doug Thistlethwaite @ 1999-07-23 21:13 UTC (permalink / raw)
  To: Peter Mount <peter@retep.org.uk>; +Cc: Doug Thistlethwaite <doug@dupree3.dupreeinc.com>; pgsql-interfaces; doug.t@deltanet.com

Peter,

Glad you have your system back up and running! :)

I have already tried this and I received the same results as I did
without the line (Auth failure).

Your previous message stated that:

> I'm now used to the more recent backends, which use the "ALTER USER" sql
> statement, and the passwords are now stored in a hidden system table,
> which is why my examples above don't have a file name in them.
>

How do I load my original passwords into this hidden system file?  I
added the password for doug using the following command:

pg_passwd /var/postgres/passwd

<Enter User Name> Doug
<Enter User Password> db

I did not see anything in the docs about setting passwords into the
system table.  Is there a different way to enter passwords now for
postgres access?  The system password for user 'doug' is not 'db' like I
set it in the pg_passwd command.

Thanks,

Doug

Peter Mount wrote:

> On Fri, 23 Jul 1999, Doug Thistlethwaite wrote:
>
> [snip]
> > host         doug        207.155.49.102 255.255.255.255  password
> > /var/postgres/passwd
>
> Try it without anything after the password keyword, ie
>
> host doug 207.155.49.102 255.255.255.255 password
>
> --
>        Peter T Mount peter@retep.org.uk
>       Main Homepage: http://www.retep.org.uk
> PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
>  Java PDF Generator: http://www.retep.org.uk/pdf

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

* Re: [INTERFACES] Connection from win95 to postgresql using JDBC andjdk1.2
  1999-07-23 16:41 Connection from win95 to postgresql using JDBC and jdk1.2 Doug Thistlethwaite <doug@dupreeinc.com>
  1999-07-23 17:07 ` Re: [INTERFACES] Connection from win95 to postgresql using JDBC and jdk1.2 Peter Mount <peter@retep.org.uk>
  1999-07-23 21:13   ` Re: [INTERFACES] Connection from win95 to postgresql using JDBC andjdk1.2 Doug Thistlethwaite <doug@dupreeinc.com>
@ 1999-07-24 10:10     ` Peter Mount <peter@retep.org.uk>
  1999-07-24 15:40       ` Re: [INTERFACES] Connection from win95 to postgresql using JDBC andjdk1.2 Doug Thistlethwaite <doug.t@deltanet.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Peter Mount @ 1999-07-24 10:10 UTC (permalink / raw)
  To: Doug Thistlethwaite <doug@dupreeinc.com>; +Cc: Doug Thistlethwaite <doug@dupree3.dupreeinc.com>; pgsql-interfaces; doug.t@deltanet.com

On Fri, 23 Jul 1999, Doug Thistlethwaite wrote:

> Peter,
> 
> Glad you have your system back up and running! :)
> 
> I have already tried this and I received the same results as I did
> without the line (Auth failure).
> 
> Your previous message stated that:
> 
> > I'm now used to the more recent backends, which use the "ALTER USER" sql
> > statement, and the passwords are now stored in a hidden system table,
> > which is why my examples above don't have a file name in them.
> >
> 
> How do I load my original passwords into this hidden system file?  I
> added the password for doug using the following command:
> 
> pg_passwd /var/postgres/passwd
> 
> <Enter User Name> Doug
> <Enter User Password> db
> 
> I did not see anything in the docs about setting passwords into the
> system table.  Is there a different way to enter passwords now for
> postgres access?

Yes.

There's a hidden table called pg_shadow which contains the user names and
passwords, and a view called pg_user which lists the same thing (with *
replacing the password entries).

The ALTER USER statement updates pg_shadow, which then updates a flatfile
in the PGDATA directory (someone correct me if I'm wrong here, I'm pulling
this from memory), which is then used by the postmaster when the
connections are made.

This flat file is why ALTER USER should be used, not an UPDATE statement
on the pg_shadow table.

Peter

--
       Peter T Mount peter@retep.org.uk
      Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
 Java PDF Generator: http://www.retep.org.uk/pdf




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

* Re: [INTERFACES] Connection from win95 to postgresql using JDBC andjdk1.2
  1999-07-23 16:41 Connection from win95 to postgresql using JDBC and jdk1.2 Doug Thistlethwaite <doug@dupreeinc.com>
  1999-07-23 17:07 ` Re: [INTERFACES] Connection from win95 to postgresql using JDBC and jdk1.2 Peter Mount <peter@retep.org.uk>
  1999-07-23 21:13   ` Re: [INTERFACES] Connection from win95 to postgresql using JDBC andjdk1.2 Doug Thistlethwaite <doug@dupreeinc.com>
  1999-07-24 10:10     ` Re: [INTERFACES] Connection from win95 to postgresql using JDBC andjdk1.2 Peter Mount <peter@retep.org.uk>
@ 1999-07-24 15:40       ` Doug Thistlethwaite <doug.t@deltanet.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Doug Thistlethwaite @ 1999-07-24 15:40 UTC (permalink / raw)
  To: Peter Mount <peter@retep.org.uk>; +Cc: Doug Thistlethwaite <doug@dupreeinc.com>; Doug Thistlethwaite <doug@dupree3.dupreeinc.com>; pgsql-interfaces

Peter,

Ok, I looked and there was a table pg_user.  I notice it is in the template and
my database.  I modified it using the command (in psql)
ALTER USER doug with PASSWORD FRED;
This seems to have worked and the command returned ALTER USER.

Ok I removed the file name in the pg_hba.conf file and restarted postgres.

I get the same message when I try to connect from Java on the PC! :(

As a test, I tried this command from the linux shell

psql -u -h localhost doug

Username: doug
password: fred

Everything seems to work fine.

I also tried the same command with a bogus password and it also worked! so the
above statement must not be checking passwords or something.

I am totally lost on what to do.

Doug


Peter Mount wrote:

> On Fri, 23 Jul 1999, Doug Thistlethwaite wrote:
>
> > Peter,
> >
> > Glad you have your system back up and running! :)
> >
> > I have already tried this and I received the same results as I did
> > without the line (Auth failure).
> >
> > Your previous message stated that:
> >
> > > I'm now used to the more recent backends, which use the "ALTER USER" sql
> > > statement, and the passwords are now stored in a hidden system table,
> > > which is why my examples above don't have a file name in them.
> > >
> >
> > How do I load my original passwords into this hidden system file?  I
> > added the password for doug using the following command:
> >
> > pg_passwd /var/postgres/passwd
> >
> > <Enter User Name> Doug
> > <Enter User Password> db
> >
> > I did not see anything in the docs about setting passwords into the
> > system table.  Is there a different way to enter passwords now for
> > postgres access?
>
> Yes.
>
> There's a hidden table called pg_shadow which contains the user names and
> passwords, and a view called pg_user which lists the same thing (with *
> replacing the password entries).
>
> The ALTER USER statement updates pg_shadow, which then updates a flatfile
> in the PGDATA directory (someone correct me if I'm wrong here, I'm pulling
> this from memory), which is then used by the postmaster when the
> connections are made.
>
> This flat file is why ALTER USER should be used, not an UPDATE statement
> on the pg_shadow table.
>
> Peter
>
> --
>        Peter T Mount peter@retep.org.uk
>       Main Homepage: http://www.retep.org.uk
> PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
>  Java PDF Generator: http://www.retep.org.uk/pdf




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


end of thread, other threads:[~1999-07-24 15:40 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-07-23 16:41 Connection from win95 to postgresql using JDBC and jdk1.2 Doug Thistlethwaite <doug@dupreeinc.com>
1999-07-23 17:07 ` Peter Mount <peter@retep.org.uk>
1999-07-23 21:13   ` Re: [INTERFACES] Connection from win95 to postgresql using JDBC andjdk1.2 Doug Thistlethwaite <doug@dupreeinc.com>
1999-07-24 10:10     ` Re: [INTERFACES] Connection from win95 to postgresql using JDBC andjdk1.2 Peter Mount <peter@retep.org.uk>
1999-07-24 15:40       ` Re: [INTERFACES] Connection from win95 to postgresql using JDBC andjdk1.2 Doug Thistlethwaite <doug.t@deltanet.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