• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    미해결

url, username, password 오류가 나옵니다

19.08.07 22:39 작성 조회수 2.09k

0

Exception in thread "main" org.postgresql.util.PSQLException: Ä¡¸íÀû¿À·ù: »ç¿ëÀÚ "keesun"ÀÇ password ÀÎÁõÀ» ½ÇÆÐÇß½À´Ï´Ù (pgjdbc: autodetected server-encoding to be ISO-8859-1, if the message is not readable, please check database logs and/or host, port, dbname, user, password, pg_hba.conf)

at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:520)

at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:141)

at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:192)

at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)

at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195)

at org.postgresql.Driver.makeConnection(Driver.java:458)

at org.postgresql.Driver.connect(Driver.java:260)

at java.sql.DriverManager.getConnection(DriverManager.java:664)

at java.sql.DriverManager.getConnection(DriverManager.java:247)

at me.whiteship.Application.main(Application.java:15)

---------------------------------------------------------------

 

package me.whiteship;

 

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.SQLException;

 

public class Application {

 

public static void main(String[] args) throws SQLException {

 

String url = "jdbc:postgresql://localhost:5432/springdata";

String username = "keesun";

String password = "pass";

 

try(Connection connection = DriverManager.getConnection(url, username, password)) {

System.out.println("Connection created : " + connection);

}

}

 

}

윈도우 사용중입니다.

 

도커에서 생성하고 돌아가는거 확인하고

postgresql도 설치했는데 이런 에러가 뜨네요

답변 1

답변을 작성해보세요.

0

DB 인코딩 문제 같습니다. 도커 이미지로 컨테이너 생성할 때 인코딩을 설정하는 옵션이 있을 겁니다. 어떤 옵션을 어떻게 설정할 수 있는지 찾아보시고 UTF-8로 설정해 보세요.