ClassNotFoundException for com.microsoft.sqlserver.jdbc.SQLServerDriver

后端 未结 1 554
傲寒
傲寒 2021-01-27 15:33

This is an issue that has come up before on SO, and I\'m sure seasoned Java devs are tired of telling newbies howto set the classpath. That said, I\'ve tried setting the classpa

1条回答
  •  抹茶落季
    2021-01-27 16:29

    You're halfway there. You include the JDBC JAR on your classpath when you compile, but you also need to include it on your classpath when you execute it as well:

    java -cp .:/path/to/sqljdbc42.jar connectURL
    

    0 讨论(0)
提交回复
热议问题