java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
https://spring.io/guides/gs/accessing-data-mysql/
it run successfully, then I try to change it to connect to my local sql server, so I add
in pom.xml, and in application.properties, I change it to
and then in my run configuration, I kept it unchange, that is,
java 17, -cp accessing-data-mysql-complete
com.example.accessingdatamysql.AccessingDataMysqlApplication
then I run this configuration, but now error:
java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:467) at org.springframework.util.ClassUtils.forName(ClassUtils.java:283) at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.driverClassIsLoadable(DataSourceProperties.java:190) at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.determineDriverClassName(DataSourceProperties.java:171) at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.initializeDataSourceBuilder(DataSourceProperties.java:123) at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration.createDataSource(DataSourceConfiguration.java:48) at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari.dataSource(DataSourceConfiguration.java:90) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) .......
is shown, why? the same run configuration is success to run the mysql sample.
2) and in intellij console, I cannot see what classpath it is using, any method to show the classpath this run configuration is using?
3) in intellij project settings > Modules > Dependencies, I just see
Maven: com.mysql:mysql-connector-j:8.0.31
but no
mssql-jdbc
although my pom.xml has it, why?
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
https://www.jetbrains.com/help/idea/delegate-build-and-run-actions-to-maven.html#maven_reimport
or set auto reload as in above url
| You totally ruined the moon. You're gonna hafta pay for that you know. This tiny ad agrees: Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing |






