2012-03-06 7 views
1

데이터베이스에 연결할 수없는 것 같습니다. 그 이유는 확실하지 않습니다. 데이터베이스 연결 속성 (id, password, url)은 정확하지만이 문제를 해결하는 방법을 잘 모르겠습니다. 다음과 같은 오류가 발생합니다.Netbeans에 적합한 데이터베이스가 없습니다.

Mar 6, 2012 4:22:56 PM Database.Database Configure 
SEVERE: No suitable driver found for 
java.sql.SQLException: No suitable driver found for 
    at java.sql.DriverManager.getConnection(DriverManager.java:602) 
    at java.sql.DriverManager.getConnection(DriverManager.java:185) 
    at Database.Database.Configure(Database.java:50) 
    at Core.Configuration.Configure(Configuration.java:61) 
    at desktopapplication2.DesktopApplication2.main(DesktopApplication2.java:51) 
Mar 6, 2012 4:22:56 PM Database.Database InsertSimulation 
SEVERE: No suitable driver found for 
java.sql.SQLException: No suitable driver found for 
    at java.sql.DriverManager.getConnection(DriverManager.java:602) 
    at java.sql.DriverManager.getConnection(DriverManager.java:185) 
    at Database.Database.InsertSimulation(Database.java:219) 
    at Core.Configuration.Configure(Configuration.java:62) 
    at desktopapplication2.DesktopApplication2.main(DesktopApplication2.java:51) 
Mar 6, 2012 4:22:56 PM Database.Database ReadCurrentSimulation 
SEVERE: No suitable driver found for 
java.sql.SQLException: No suitable driver found for 
    at java.sql.DriverManager.getConnection(DriverManager.java:602) 
    at java.sql.DriverManager.getConnection(DriverManager.java:185) 
    at Database.Database.ReadCurrentSimulation(Database.java:341) 
    at Core.Configuration.Configure(Configuration.java:63) 
    at desktopapplication2.DesktopApplication2.main(DesktopApplication2.java:51) 
Mar 6, 2012 4:22:56 PM Database.Database ReadCurrentConfiguration 
SEVERE: No suitable driver found for 
java.sql.SQLException: No suitable driver found for 
    at java.sql.DriverManager.getConnection(DriverManager.java:602) 
    at java.sql.DriverManager.getConnection(DriverManager.java:185) 
    at Database.Database.ReadCurrentConfiguration(Database.java:253) 
    at Core.Configuration.ReadCurrentConfiguration(Configuration.java:237) 
    at Core.Configuration.Configure(Configuration.java:64) 
    at desktopapplication2.DesktopApplication2.main(DesktopApplication2.java:51) 
Mar 6, 2012 4:22:56 PM Database.Database ReadCurrentConfigAsString 
SEVERE: No suitable driver found for 
java.sql.SQLException: No suitable driver found for 
    at java.sql.DriverManager.getConnection(DriverManager.java:602) 
    at java.sql.DriverManager.getConnection(DriverManager.java:185) 
    at Database.Database.ReadCurrentConfigAsString(Database.java:386) 
    at Core.Configuration.ReadConfigFromDB(Configuration.java:172) 
    at Core.Configuration.CompareConfig(Configuration.java:203) 
    at Core.Configuration.Configure(Configuration.java:66) 
    at desktopapplication2.DesktopApplication2.main(DesktopApplication2.java:51) 
Mar 6, 2012 4:22:56 PM Database.Database InsertConfiguration 
SEVERE: No suitable driver found for 
java.sql.SQLException: No suitable driver found for 
    at java.sql.DriverManager.getConnection(DriverManager.java:602) 
    at java.sql.DriverManager.getConnection(DriverManager.java:185) 
    at Database.Database.InsertConfiguration(Database.java:120) 
    at Core.Configuration.InsertConfig(Configuration.java:225) 
    at Core.Configuration.Configure(Configuration.java:68) 
    at desktopapplication2.DesktopApplication2.main(DesktopApplication2.java:51) 
Mar 6, 2012 4:22:56 PM Database.Database ReadCurrentConfiguration 
SEVERE: No suitable driver found for 
java.sql.SQLException: No suitable driver found for 
    at java.sql.DriverManager.getConnection(DriverManager.java:602) 
    at java.sql.DriverManager.getConnection(DriverManager.java:185) 
    at Database.Database.ReadCurrentConfiguration(Database.java:253) 
    at Core.Configuration.ReadCurrentConfiguration(Configuration.java:237) 
    at Core.Configuration.Configure(Configuration.java:69) 
    at desktopapplication2.DesktopApplication2.main(DesktopApplication2.java:51) 
Mar 6, 2012 4:22:56 PM Database.Database ReadEssentialAppliances 
SEVERE: No suitable driver found for 
java.sql.SQLException: No suitable driver found for 
    at java.sql.DriverManager.getConnection(DriverManager.java:602) 
    at java.sql.DriverManager.getConnection(DriverManager.java:185) 
    at Database.Database.ReadEssentialAppliances(Database.java:483) 
    at Core.Configuration.ReadEssentialAppliances(Configuration.java:115) 
    at Core.Configuration.Configure(Configuration.java:71) 
    at desktopapplication2.DesktopApplication2.main(DesktopApplication2.java:51) 
Mar 6, 2012 4:22:56 PM Database.Database ReadNonEssentialAppliances 
SEVERE: No suitable driver found for 
java.sql.SQLException: No suitable driver found for 
    at java.sql.DriverManager.getConnection(DriverManager.java:602) 
    at java.sql.DriverManager.getConnection(DriverManager.java:185) 
    at Database.Database.ReadNonEssentialAppliances(Database.java:431) 
    at Core.Configuration.ReadNonEssentialAppliances(Configuration.java:144) 
    at Core.Configuration.Configure(Configuration.java:72) 
    at desktopapplication2.DesktopApplication2.main(DesktopApplication2.java:51) 
Mar 6, 2012 4:22:56 PM Database.Database InsertHome 
SEVERE: No suitable driver found for 
java.sql.SQLException: No suitable driver found for 
    at java.sql.DriverManager.getConnection(DriverManager.java:602) 
    at java.sql.DriverManager.getConnection(DriverManager.java:185) 
    at Database.Database.InsertHome(Database.java:90) 
    at Core.SmartHome.InsertSmartHome(SmartHome.java:34) 
    at Core.SmartHome.<init>(SmartHome.java:28) 
    at Core.Processor.CreateHomes(Processor.java:65) 
    at Core.Processor.Start(Processor.java:43) 
    at desktopapplication2.DesktopApplication2.main(DesktopApplication2.java:52) 
Mar 6, 2012 4:22:56 PM Database.Database ReadCurrentHome 
SEVERE: No suitable driver found for 
java.sql.SQLException: No suitable driver found for 
    at java.sql.DriverManager.getConnection(DriverManager.java:602) 
    at java.sql.DriverManager.getConnection(DriverManager.java:185) 
    at Database.Database.ReadCurrentHome(Database.java:297) 
    at Core.SmartHome.InsertSmartHome(SmartHome.java:35) 
    at Core.SmartHome.<init>(SmartHome.java:28) 
    at Core.Processor.CreateHomes(Processor.java:65) 
    at Core.Processor.Start(Processor.java:43) 
    at desktopapplication2.DesktopApplication2.main(DesktopApplication2.java:52) 
+1

속성에 관한 것이 아니라 "jar"파일에 관한 것입니다. ClassPath에 없습니다 .. 아니면 완전히 누락되었습니다 .. !! –

+0

ive는 lib에 파일을 추가했지만 여전히 오류가 발생합니다 –

+0

사용중인 폴더에 다른 lib가 있습니까 .. ?? .. "libpath가 클래스 경로에 없습니다"..! ! –

답변

0

데이터베이스 연결을 얻기 전에 Class.forName()을 호출하여 수동으로 드라이버 클래스를로드 해보십시오. 예를 들어, MySQL 데이터베이스를 사용하는 경우 데이터베이스 연결을 가져 오기 위해 문 위에 다음 문을 추가하십시오.

0

다음 단계를 사용하여 클래스 경로에 데이터베이스 드라이버 (JAR (s))를 추가하십시오. 이렇게하면 문제가 해결됩니다.

1. Select your project from the Projects explorer. 
2. Right click -> Properties. 
3. Select Libraries from Categories list. 
4. Click on Add JAR/Folder button. 
5. Add your jar(s) & click on OK to finish the process. 
관련 문제