Received: from www.kpi.com.au (www.kpi.com.au [203.39.132.210]) by hub.org (8.10.1/8.10.1) with ESMTP id e5S3cr178519 for ; Tue, 27 Jun 2000 23:38:54 -0400 (EDT) Received: from grail (www.kpi.com.au [203.39.132.210]) by www.kpi.com.au (8.9.3/8.9.3) with SMTP id NAA19283; Wed, 28 Jun 2000 13:35:05 +1000 (EST) (envelope-from shevlandj@kpi.com.au) From: "Joe Shevland" To: "Marcus Alday" , Subject: RE: Need help getting JDBC setup. Date: Wed, 28 Jun 2000 13:36:33 +1000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal In-Reply-To: <395720E7.8493B54@home.com> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by hub.org id e5S3ct178540 X-Archive-Number: 200006/110 Looks all fine to me. What are the results of doing a 'psql -U' and specifying the username and password from the command line? Regards, Joe >-----Original Message----- >From: pgsql-interfaces-owner@hub.org >[mailto:pgsql-interfaces-owner@hub.org]On Behalf Of Marcus Alday >Sent: Monday, 26 June 2000 7:23 PM >To: pgsql-interfaces@postgresql.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.(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@home.com > > >