http://motionsharing.com/site/download/acefad55f1e81e456d71a7448b278915이클립스 데이터 소스 탐색기에서 MySQL 데이터베이스에 연결할 수 없습니다 이클립스 데이터 소스 탐색기
에서 MySQL 데이터베이스에 연결할 수 없습니다.
적절한 드라이버를 조정했지만 연결할 수 없습니다. P.S. : derby db에 연결할 수 있으며 코드에서만 mysql db에 연결할 수 있지만 데이터 소스 탐색기에서 mysql db에 연결하여 테이블 생성 등의 작업을 수행 할 수 있습니다.
무엇이 잘못 되었나요?
코드를 통해 연결할 수 있습니다.
public static void main(String args[]) {
try {
Class.forName("com.mysql.jdbc.Driver");
System.out.println("Driver loading success!");
String url = "jdbc:mysql://localhost:3306/mydb";
String name = "root";
String password = "root";
try {
Connection con = DriverManager.getConnection(url, name, password);
System.out.println("Connected.");
con.close();
System.out.println("Disconnected.");
} catch (SQLException e) {
e.printStackTrace();
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
하지만 com.mysql.jdbc.Driver는 무엇입니까? – ASD
MySQL 데이터베이스에 연결하는 라이브러리입니다. 게시 한 링크에서 다운로드하면 찾으실 수 있습니다. – adarshr