Java MySQL DB 연결




Intro


Java WEB개발을 위해 필요한
MySQL community server 5.7 연결 방법


How to


우선 MySQL community server 5.7을 설치한다.

 1

Developer Default 선택 - 설치 진행

 2
 3
 4

설치 완료 후 MySQL Command Line Client 실행

 5

Java와 연동을 하기 위한 Connector J 설치

 6

.TAR 또는 .ZIP 파일 내 mysql-connector-java-5.1.40-bin.jar
프로젝트 - WebContent - WEB-INF - lib 에 복사한다.

 7

Window - Show View - Data source explorer 선택

  • 없을 경우 : Window - Show View - other - Data Management 내 Data source explorer 선택)
  • 이것도 없을 경우 : Help - Install New Software 이동

     8

Add… 선택

 9

Location 에 입력 : url + 버전 (아래 예시는 neon 버전)
Ex) http://download.eclipse.org/releases/neon

 10

Database Development 선택 후 Next 눌러 설치

 11

Database Connections - 오른쪽 클릭 - New - MySQL 선택

 12
 13

Test Connection 눌러서 Ping Test

 14

연동 완료