2012-03-06 11 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」ファイルについてです。クラスパスにはありませんか、まったくありません。 –

+0

iveはlibにファイルを追加しましたが、まだエラーが表示されます –

+0

あなたが使用しているフォルダに他のlibがありますか?..私は確かに "libはクラスパスに存在しません" ..! ! –

答えて

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. 
関連する問題