Java MySQL DB 연결
20 Aug 2017Intro
Java WEB개발을 위해 필요한
MySQL community server 5.7 연결 방법
How to
우선 MySQL community server 5.7을 설치한다.
Developer Default 선택 - 설치 진행
설치 완료 후 MySQL Command Line Client 실행
Java와 연동을 하기 위한 Connector J 설치
.TAR
또는 .ZIP
파일 내 mysql-connector-java-5.1.40-bin.jar
를
프로젝트 - WebContent - WEB-INF - lib 에 복사한다.
Window - Show View - Data source explorer 선택
- 없을 경우 : Window - Show View - other - Data Management 내 Data source explorer 선택)
- 이것도 없을 경우 : Help - Install New Software 이동
Add… 선택
Location 에 입력 : url + 버전
(아래 예시는 neon 버전)
Ex) http://download.eclipse.org/releases/neon
Database Development 선택 후 Next 눌러 설치
Database Connections - 오른쪽 클릭 - New - MySQL 선택
Test Connection 눌러서 Ping Test
연동 완료