This article is a mirror article of machine translation, please click here to jump to the original article.

View: 14930|Reply: 1

[Source] jdbcUrl is required with driverClassName.

[Copy link]
Posted on 9/9/2018 11:04:36 AM | | | |


Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Sun Sep 09 10:38:10 CST 2018
There was an unexpected error (type=Internal Server Error, status=500).
nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.lang.IllegalArgumentException: jdbcUrl is required with driverClassName. ### The error may exist in com/itsvse/test/mapper/AccountMapper.java (best guess) ### The error may involve com.itsvse.test.mapper.AccountMapper.selectAll ### The error occurred while executing a query ### Cause: java.lang.IllegalArgumentException: jdbcUrl is required with driverClassName.


Before Spring Boot 1.5.x, there were already many tutorials and examples of multi-source programming

However, after upgrading to Spring Boot 2.0, some configurations and usage have changed, and if you are not careful, you will encounter "jdbcUrl is required with driverClassName." error.

Solution:

Use spring.datasource.jdbc-url in the configuration file instead of the spring.datasource.url you normally use.


jdbc-url: jdbc:mysql://127.0.0.1:3306/mydb?useSSL=false
username: itsvse
password: 123456
driver-class-name attribute can be removed!

The difference between spring.datasource.jdbc-url and spring.datasource.url, no one on the Internet can explain it clearly, my own understanding is as follows:

With jdbc-url, there is no need for the driver-class-name property, Spring Boot will find the default driver class name based on the spring.datasource.jdbc-url property value.




Previous:How to make the mobile phone install the program to the USB flash drive by default
Next:tk.mybatis
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com