본문 바로가기
Study/Database

[이클립스] JDBC 연결 시 한글 깨짐 오류 해결 방법

by sweji 2019. 4. 16.

MySQL 과 JDBC 연동 시 한글 깨짐이 발생
----->해결 방안

1. table 생성 시 뒤에 charset으로 utf-8 표기 

Create table member(
id int(6) not null,
username nvarchar(3) not null,
dept nvarchar(5) not null,
birth nvarchar(8) not null,
email nvarchar(20) not null
) charset="utf8";

2. 연결된 database의 속성(Properties)에 들어간다
3.Driver Propertiest → URL을 수정한다.
localhost 뒤에 ? useUnicode=true&characterEncoding=utf8 작성
그래도 안된다면 &serverTimezone=UTC 추가 작성

 

 

** 왜 인지 모르겠으나 최신(2019) 버전 이클립스와 mySQL은 한글깨짐 해결 ....X  ㅜㅜㅜ

댓글