2013-04-24 3 views
0

psql 서버에 액세스하기 위해 Eclipse를 설치하고 실행하기 시작합니다. 그리고 실행중인 윈도우 7 32 비트psql org.postgresql.util.PSQLException : FATAL

이클립스에서 웹 응용 프로그램 양식에 대한 기본 양식을 설정했습니다. 내가 가진 파일은 content.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" /> 

내가 가지고 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"); 
} 

}

나는했다.

난 그냥 간단한 JSP 파일을하기 위해선, psql의 프로그램에서 데이터를 삽입하고 내가 실행 컴파일하고 때 JSP 내가 오류를

org.postgresql.util을 얻고있다

를 제출하지 .PSQLException : FATAL : "postgres"사용자의 비밀번호 인증에 실패했습니다.

나는 그 이유를 잘 모르겠습니다.

는 내가 4 psql를 볼 수있는 psql의 프로그램을 연결할 때와 나는 현재 이런 일이 왜 그냥 궁금

enter image description here

웹 응용 프로그램을 구축하기위한 8.4을 사용하려고하고 있습니다. 나는 방금 지시를 따르고 오류의 원인을 봤다.

하지만 작동하지 않습니다.

누구나 수정 방법을 알고 있습니까?

+0

"비밀번호 인증에 실패했습니다 * *"에 대해 명확하지 않은 점은 무엇입니까? –

답변

1

데이터베이스에 암호가 있고 나머지 매개 변수를 입력해야합니다. 또한 파일이 context.xml (content.xml이 아님)인지 확인하십시오.

관련 문제