简体   繁体   English

当运行可执行 jar 文件时,我有和 SQLException:没有找到适合 jdbc:mysql://localhost:3306/DENTAL 的驱动程序

[英]When run executable jar file i have and SQLException: No suitable driver found for jdbc:mysql://localhost:3306/DENTAL

I am working on a project, my project should be connected with Database , When I run it on NetBeans it works perfectly, But when I am try to run the executable jar file i have an error like this,我正在做一个项目,我的项目应该与Database连接,当我在NetBeans上运行它时,它运行良好,但是当我尝试运行可执行的 jar 文件时,我遇到了这样的错误,

"No suitable driver found for jdbc:mysql://localhost:3306/DENTAL"

please note that I added the mysql-connecter.jar to libraries.请注意,我将mysql-connecter.jar添加到库中。

Thank you谢谢

Please use the following to generate jar file:请使用以下命令生成 jar 文件:

<build>
  <plugins>
    <plugin>
  <artifactId>maven-assembly-plugin</artifactId>
  <configuration>
    <archive>
      <manifest>
        <mainClass>edu.learn.App</mainClass>
      </manifest>
    </archive>
    <descriptorRefs>
      <descriptorRef>jar-with-dependencies</descriptorRef>
    </descriptorRefs>
  </configuration>
  <executions>
    <execution>
      <id>make-runnable-jar</id> 
      <phase>package</phase> 
      <goals>
        <goal>single</goal>
      </goals>
    </execution>
  </executions>
</plugin>
  </plugins>
</build>

then run mvn clean package然后运行 mvn clean package

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SQLException:找不到适用于jdbc:mysql:// localhost:3306 / dbname的驱动程序 - SQLException: No suitable driver found for jdbc:mysql://localhost:3306/dbname java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/mydatabase Android Studio Java MySQL - java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/mydatabase Android Studio Java MySQL JAVA 10-java.sql.SQLException:找不到适用于jdbc:mysql:// localhost:3306 /错误的驱动程序 - JAVA 10 - java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/ error 引起:java.sql.SQLException:没有为jdbc找到合适的驱动程序:mysql:// localhost:3306 / domain - Caused by: java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/domain 数据库连接上的 SQLException:找不到适合 jdbc:mysql://localhost:3306/smtbiz 的驱动程序 - SQLException on database connection: No suitable driver found for jdbc:mysql://localhost:3306/smtbiz java.sql.SQLException: 找不到适合 jdbc:mysql://localhost:3306/sushi 的驱动程序 - java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/sushi java.sql.SQLException:找不到适用于jdbc:mysql:// localhost:3306 / tun_recrut的驱动程序 - java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/tun_recrut 连接错误:java.sql.SQLException:没有找到适用于 jdbc:Z81C3B080DAD534BF52EZE://030364BF52E10的驱动程序 - Error de conexion: java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306 java.sql.SQLException:找不到适用于jdbc:mysql:// localhost:3306的驱动程序 - java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306 java.sql.SQLException: 找不到适合 jdbc:mysql://localhost:3306/database 的驱动程序 - java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/database
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM