質問させてください
Eclipseで作成したsqlを使ったプロジェクトを、zipにして他のパソコンでも実行できるようにしたいと思い、zipにしてから解凍し、コマンドプロンプトで実行しようとしたところ、
No suitable driver found for jdbc:mysql:
とエラーが出てしまいました。
調べるとJDBCがCLASSPATHに設定されていないのが原因らしいので、CLASSPATHファイルを見てみたところ、Eclipseで作成したユーザーライブラリが書かれていました。
どうすればCLASSPATHにJDBCのjarファイルを設定出来るでしょうか、教えてくださると助かります。
DBコネクションエラー:No suitable driver found for jdbc:mysql://localhost/schedules DBコネクションエラー:No suitable driver found for jdbc:mysql://localhost/schedules Exception in Application start method java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464) at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1071) Caused by: java.lang.RuntimeException: Exception in Application start method at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195) at java.base/java.lang.Thread.run(Thread.java:831) Caused by: javafx.fxml.LoadException: /C:/Users/user/Downloads/ScheduleTable-master/src/application/CalendarIndividual.fxml at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2707) at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2677) at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548) at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:2517) at application.CalendarMain.start(CalendarMain.java:15) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:474) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:447) at java.base/java.security.AccessController.doPrivileged(AccessController.java:391) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:446) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174) ... 1 more Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:76) at jdk.internal.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:273) at javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:83) at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2673) ... 12 more Caused by: java.lang.NullPointerException: Cannot invoke "java.sql.Connection.prepareStatement(String)" because "this.con" is null at application.ScheduleDAO.findByDate(ScheduleDAO.java:129) at application.CalendarController.setCalendar(CalendarController.java:236) at application.CalendarController.initialize(CalendarController.java:196) ... 23 more Exception running application application.CalendarMain
回答2件
あなたの回答
tips
プレビュー