Re: Need help getting JDBC setup.

From: stephen wright <stephen(dot)wright(at)vodacom(dot)co(dot)za>
To: Peter Mount <petermount(at)it(dot)maidstone(dot)gov(dot)uk>
Cc: "'Marcus Alday'" <alday(at)home(dot)com>, pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Need help getting JDBC setup.
Date: 2000-06-28 10:01:08
Message-ID: 3959CCE3.E078395E@vodacom.co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Hi there

I've got something similar, but using the C interface (using libpq)

When I am an ordinary user (no createdb or createuser priv etc) and try to
change my
password with "alter user xyz with password abc" , I get an error that I do not
have
update privs in the pg_shadow table

What I still would like to know is how to allow a not priviledged user to
changed his/her
password from my application

Thanx
Stephen

Peter Mount wrote:

> Hmmm, this is a wierd one. I can't see anything wrong with either your
> pg_hba.conf, nor the java code.
>
> What happens if you change password to crypt in pg_hba.conf? (crypt is
> virtually the same as password)
>
> --
> Peter Mount
> Enterprise Support
> Maidstone Borough Council
> Any views stated are my own, and not those of Maidstone Borough Council
>
> -----Original Message-----
> From: Marcus Alday [mailto:alday(at)home(dot)com]
> Sent: Monday, June 26, 2000 10:23 AM
> To: pgsql-interfaces(at)postgresql(dot)org
> Subject: [INTERFACES] Need help getting JDBC setup.
>
> Hi,
> I'm trying to get the JDBC driver to interface with my database,
> and I
> can't, for the life of me, figure out what's going on. I am hoping one
> of the
> postgresql gurus out there could help me out a little.
>
> I'm running RedHat 6.2, and I'm running the standard Posgresql
> distribution
> that came with RedHat. I believe it's 6.5.2. I have downloaded the JDBC
> drivers
> and installed them at
>
> /usr/lib/pgsql/jdbc6.5.2.jar
>
> I have modified the pg_hba.conf file to have the line
>
> host all 127.0.0.1 255.255.255.255 password
>
> I have added a user 'client' by doing a 'CREATE USER client SET PASSWORD
> password'
> ( or something like that. The password is not 'password')
>
> Here is the java code I have to try and test this
>
> /**
> * Code from aw_pgsql_book.pdf pg 191
> *
> **/
> import java.io.*;
> import java.sql.*;
>
> public class test
> {
> Connection conn;
> Statement stmt;
> String state_code;
>
> public test() throws ClassNotFoundException,
> FileNotFoundException,
> IOException,
> SQLException
> {
> Class.forName("postgresql.Driver");
> conn =
> DriverManager.getConnection("jdbc:postgresql:coffeebreak","client","password
> ");
>
> stmt = conn.createStatement();
>
> ResultSet res = stmt.executeQuery ( "SELECT * FROM
> coffees");
> if(res != null)
> {
> while(res.next())
> {
> String str1 = res.getString(1);
> System.out.println(str1);
> }
> }
> res.close();
> stmt.close();
> conn.close();
> }
>
> public static void main(String args[])
> {
> try
> {
> test t = new test();
> }
> catch( Exception e )
> {
> System.err.println("Exception caught: " + e );
> e.printStackTrace();
> }
> }
> }
>
> And the error I get is this:
>
> Exception caught: Something unusual has occured to cause the driver to
> fail.
> Please report this exception: java.sql.SQLException: Password
> authentication
> failed for user 'client'
>
> Something unusual has occured to cause the driver to fail. Please report
> this
> exception: java.sql.SQLException: Password authentication failed for
> user 'client'
> at postgresql.Driver.connect(Driver.java, Compiled Code)
> at java.sql.DriverManager.getConnection(DriverManager.java,
> Compiled Code)
> at java.sql.DriverManager.getConnection(DriverManager.java,
> Compiled Code)
> at test.<init>(test.java, Compiled Code)
> at test.main(test.java, Compiled Code)
>
> Now I'm not sure why I'm getting an authentication error, as I'm using
> the correct password in my
> code. Does anyone have an idea?
>
> thanks
> marcus alday
>
> alday(at)home(dot)com

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Carolyn Lu Wong 2000-06-28 12:40:44 ODBC question
Previous Message Rolf Lüttecke 2000-06-28 08:42:39 Re:Need help getting JDBC setup