데이터베이스에 연결하기위한 클래스에이 코드가 있습니다.java.sql.SQLException : Netbeans에 적합한 드라이버가 없습니다.
package fullhouse;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
public class FullhouseDB {
private static Connection databaseConnectie;
public static Connection getConnection() {
if(databaseConnectie == null){
String connectString = "jdbc:mysql://localhost:3306/fullhouse";
try {
databaseConnectie = DriverManager.getConnection(connectString, "root", "2002112735");
} catch (SQLException ex) {
Logger.getLogger(FullhouseDB.class.getName()).log(Level.SEVERE, null, ex);
}
}
return databaseConnectie;
}
와 나는이 오류를 얻을 : 나는 사용자 이름과 암호, 데이터베이스 서비스의 연결을 확인했습니다
dec 29, 2014 5:05:49 PM fullhouse.FullhouseDB getConnection
SEVERE: null
java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/fullhouse
을, 모든 올바른 것입니다.
Class.forName("com.mysql.jdbc.Driver");
그리고 연결 문자열 URL을 정의
클래스 경로에 MySQL 데이터베이스 용 드라이버 JAR이 있습니까? – vanje
태그에 sql-server가 표시되지만 url에 mysql이 있습니까? – SMA