psql org.postgresql.util。PSQLException:致命的

时间:2021-02-13 23:07:46

I just start to install and run eclipse to access to psql server. And running windows 7 32 bits

我只是开始安装和运行eclipse来访问psql server。运行windows 7 32位。

I just set up the basic form for web app form in the eclipse.

我只是在eclipse中设置了web应用程序表单的基本形式。

in the content.xml file i have..

的内容。xml文件我有. .

<Context path="" debug="5" override="true" reloadable="true">
<Resource   name="jdbc/connection_pool"
            description="DB Connection Pool"
            driverClassName="org.postgresql.Driver"
            type="javax.sql.DataSource"
            auth="Container"
            url="jdbc:postgresql://localhost/students-database" 
            username="postgres"
            password="1234"
            defaultAutoCommit="false"
            maxActive="10"
            minIdle="0"
            maxIdle="5"
            maxWait="3000"
            removeAbandoned="true"
            removeAbandonedTimeout="60"
            logAbandoned="true"
            validationQuery="SELECT 1" />

and

in the DbConnectionPool.jave i have..

DbConnectionPool。jave我. .

public class DbConnectionPool {

// Registering Postgresql JDBC driver with the DriverManager
static {
    try {
        Class.forName("org.postgresql.Driver");
    } catch (ClassNotFoundException e) {
        throw new RuntimeException(e);
    }
}

/**
 * Returns a <code>java.sql.Connection</code> object.
 * 
 * @exception NamingException
 *                if the JDBC resource is not found
 * @exception SQLException
 *                if a connection can not be obtained
 * 
 * @return Connection to use
 */
public static Connection getConnection() throws NamingException,
        SQLException {

    // TODO: To be replaced with real connection pool after we have covered it in class

    return DriverManager.getConnection(
            "jdbc:postgresql://localhost/students-database?" +
            "user=postgres&password=1234");
}

}

}

I didn't insert the any data in the psql program,

我没有在psql程序中插入任何数据,

i just make simple jsp file and when I am compiling to run jsp file

我只做简单的jsp文件,当我编译运行jsp文件时。

i am getting error

我得到错误

org.postgresql.util.PSQLException: FATAL: password authentication failed for user "postgres"

org.postgresql.util。PSQLException:致命的:用户“postgres”失败的密码验证

I am not really sure why.

我不知道为什么。

when i connect the psql program i can see the 4 psql and i am currently try to use 8.4 for building web-app

当我连接psql程序时,我可以看到4个psql,我现在尝试使用8.4来构建web应用程序。

psql org.postgresql.util。PSQLException:致命的

I just wondering why this happen. I just followed direction and I googled cause of errors.

我只是想知道为什么会这样。我只是按了方向,搜索了错误的原因。

but doesn't work.

但不工作。

does anyone know how to fix it ?

有人知道怎么修理吗?

1 个解决方案

#1


1  

I'm going to guess you have a password on the database and you need to provide it with the rest of the parameters. Also, make sure the file is context.xml not content.xml.

我猜你在数据库上有一个密码,你需要向它提供其余的参数。另外,确保文件是上下文。xml不是xml。

#1


1  

I'm going to guess you have a password on the database and you need to provide it with the rest of the parameters. Also, make sure the file is context.xml not content.xml.

我猜你在数据库上有一个密码,你需要向它提供其余的参数。另外,确保文件是上下文。xml不是xml。