Home > database >  For help: Spring MyBatis MySQL integration errors
For help: Spring MyBatis MySQL integration errors

Time:09-29

On March 3, 2018 com 9:45:58 morning. McHange. V2. C3p0. DriverManagerDataSource ensureDriverLoaded
Warning: Could not load driverClass ${JDBC. DriverClass}
Java. Lang. ClassNotFoundException: ${JDBC. DriverClass}
At java.net

. URLClassLoader. FindClass (Unknown Source)
The at Java. Lang. This loadClass (Unknown Source)
At sun. Misc. The Launcher $AppClassLoader. LoadClass (Unknown Source)
The at Java. Lang. This loadClass (Unknown Source)
The at Java. Lang. Class. ForName0 (Native Method)
The at Java. Lang. Class.forname (Unknown Source)
At com. McHange. V2. C3p0. DriverManagerDataSource. EnsureDriverLoaded (100). DriverManagerDataSource Java:
At com. McHange. V2. C3p0. DriverManagerDataSource. GetConnection (132). DriverManagerDataSource Java:
At com. McHange. V2. C3p0. WrapperConnectionPoolDataSource. GetPooledConnection (WrapperConnectionPoolDataSource. Java: 182)
At com. McHange. V2. C3p0. WrapperConnectionPoolDataSource. GetPooledConnection (WrapperConnectionPoolDataSource. Java: 171)
At com. McHange. V2. C3p0. Impl. C3P0PooledConnectionPool $1 pooledconnectionresourcepoolmanager. AcquireResource (C3P0PooledConnectionPool. Java: 137)
At com. McHange. V2. Resourcepool. BasicResourcePool. DoAcquire (BasicResourcePool. Java: 1014)
At com. McHange. V2. Resourcepool. BasicResourcePool. Access the $800 (BasicResourcePool. Java: 32)
At com. McHange. V2. Resourcepool. BasicResourcePool $AcquireTask. Run (1810) BasicResourcePool. Java:
At com. McHange. V2. Async. ThreadPoolAsynchronousRunner $PoolThread. Run (547) ThreadPoolAsynchronousRunner. Java:

The applicationcontext.xml configuration is as follows:






Dbconfig. Properties configuration is as follows:

. The JDBC driver=com. Mysql.. JDBC driver
JDBC url=JDBC: mysql://localhost: 3306/mybatisdb
JDBC. Username=root
JDBC. Password=123456

CodePudding user response:

Dbconfig. Properties configured JDBC driver, you why want to use ${JDBC. DriverClass}, ${. JDBC driver}
  • Related