[Solved] Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNotFoundException: Cannot find cla

preface

The problem encountered when learning Mybatis for the first time, when writing the global configuration file SqlMapConfig.xml, in the database connection pool section would like to introduce the configuration of db.properties as follows.

db.properties configuration

SqlMapConfig.xml

The error reports given are:

Error setting driver on UnpooledDataSource. Cause:java.lang.ClassNotFoundException: Cannot find class: ${jdbc.driver}

No corresponding connection was obtained. Because the properties file was not loaded:

After Add <properties> labeling, the program runs normally.

Done.

Read More: