Hi,

I am Manoj,TYBCS student from SP College.

Can some one help me out with this problem. I have been searching around for
some help but couldnt find any...

Im trying to connect PostgreSQL with Java..

//Prog Name:Connec.java

import java.sql.*;

public class Connec

{

public static void main(String args[])

{

ResultSet r;

try

{

Class.forName("org.postgresql.Driver");

String url="jdbc:postgresql:manoj";

String username="manoj";

String password="";

Connection c=DriverManager.getConnection(url,username,password);

}//try

catch(Exception e)

{

System.out.println("Error"+e);

}//catch

}//main

}//class



/*************************************************************************************

In this program

String url="jdbc:postgresql:manoj";

Here manoj is database name

String username="manoj";

Here manoj is username.

****************************************************************************************/

// After Compilation No Errors

[EMAIL PROTECTED] ~]$ javac Connec.java

// But error in Runtime

[EMAIL PROTECTED] ~]$ java Connec

Error A connection error has occurred: FATAL: Ident authentication failed
for user "manoj"



//My bash_profile file is

# .bash_profile

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/usr/java/jdk1.5.0_07/bin:.

CLASSPATH=/usr/java/jdk1.5.0_07/lib/tools.jar:/usr/java/jdk1.5.0_07/jre/lib/rt.jar:/usr/java/pg73jdbc3.jar:.

export PATH CLASSPATH

unset USERNAME





/******************

I already created a postgres account

using

createuser manoj

createdb manoj

*************************************/

/*************************************

String url="jdbc:postgresql:postgres";

String username="postgres";

OR

String url="jdbc:postgresql:root";

String username="root";

Gives the same problem

Error A connection error has occurred: FATAL: Ident authentication failed
for user"postgres"

OR

Error A connection error has occurred: FATAL: Ident authentication failed
for user "root"

******************************************/

I have "Fedora 4".Please tell me what can i do to solve this problem.

Thanks

Manoj Gudi.
--
______________________________________________________________________
Pune GNU/Linux Users Group Mailing List:      ([email protected])
List Information:  http://plug.org.in/cgi-bin/mailman/listinfo/plug-mail
Send 'help' to [EMAIL PROTECTED] for mailing instructions.

Reply via email to