Mybatis property loading order [How to Solve]

Mybatis property loading order

⚠️ Note: if a property is configured in more than one place, mybatis will be loaded in the following order:

First read the properties specified in the properties element body. Then read the config.properties file under the classpath according to the resource attribute in the properties element, or read the property file according to the path specified by the URL attribute, and overwrite the previously read property with the same name. Finally, read the property passed as a method parameter and overwrite the previously read property with the same name.

Sort by priority: method parameters > Profile > Properties element properties

Read More: