zoukankan      html  css  js  c++  java
  • Java SpringBoot中使用sqljdbc4注意事项 java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver

    因项目需要,需要在Java项目中访问 MSSQLServer 数据库,本地开发的时候,没有问题,可以正常链接数据库,通过Jenkins部署到服务器上时候,报数据库驱动未找到。

    java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver

    原因:pom.xml 的包未找到:


    <dependency>
    <groupId>com.microsoft.sqlserver</groupId>
    <artifactId>sqljdbc4</artifactId>
    </dependency>

    解决方法:需要手工在服务器上安装一下 sqljdbc:

    mvn install:install-file -Dmaven.repo.local=/newdata/jenkins/maven-repositories/0 -Dfile=sqljdbc4-4.0.jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0 -Dpackaging=jar

  • 相关阅读:
    什么是透视图?
    Eclipse 视图
    Eclipse 菜单
    Eclipse 窗口说明
    Eclipse 修改字符集
    Eclipse 安装(Oxygen版本)
    Eclipse 教程
    jQuery 教程
    就表单验证说用户体验
    需要配置执行path?no
  • 原文地址:https://www.cnblogs.com/jimcsharp/p/9796123.html
Copyright © 2011-2022 走看看