윈도우 JDBC 실습

Jmnote (토론 | 기여)님의 2013년 5월 1일 (수) 21:51 판 (→‎같이 보기)
JDBC 실습

1 사전 작업

2 이클립스에 Connector 등록

  • 이클립스 실행
  • Window 메뉴 --- Preferences
  • "Preferences" --- Data Management --- Connectivity --- Driver Definitions
  • "Driver Definitions" --- [Add...]
  • "New Driver Definition" --- Name/Type 탭 --- Vendor Filter: MySQL 선택 --- 아래에서 MySQL 5.1 선택해보면...

다음과 에러 메시지가 보인다.

Unable to locate JAR/zip in file system as specified by the driver definition: mysql-connector-java-5.1.0-bin.jar.
→ mysql-connector-java-5.1.0-bin.jar 파일을 못찾겠다고 한다...
  • "New Driver Definition" --- Jar List 탭 --- mysql-connector-java-5.1.0-bin.jar 선택 --- [Edit JAR/Zip...]
  • "Select the file:" --- C:\Program Files (x86)\MySQL\Connector J 5.1.24 으로 이동 --- mysql-connector-java-5.1.24-bin.jar 선택 --- [열기(O)]
  • "New Driver Definition" --- Properties 탭 --- Connection URL: jdbc:mysql://localhost:3306/test --- Password: 패스워드 --- [OK]
  • [OK]

3 이클립스에 DB 연결 등록

Perspective를 바꿔보자.

  • Window 메뉴 --- Open Perspective --- Other...
  • "Open Perspective" --- Database Development 선택 --- [OK]

왼쪽 영역이 Data Source Explorer으로 바뀌었다.

  • Data Source Explorer --- Database Connections 우클릭 --- New...
  • "New Connection Profile" 창 --- MySQL 선택[1] --- [Next >]
  • URL: jdbc:mysql://localhost:3306/test --- [Test Connection]
  • "Success" 창 --- [OK]
  • [Finish]

4 같이 보기

5 주석

  1. (기본값) Name: New MySQL

6 참고 자료

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}