org.springframework.web.util.NestedServletException: Request processing failed; nested exception is

c3p0数据源书写错误,本人之前properties文件中
driver=com.mysql.jdbc.Driver
url=jdbc:mysql://127.0.0.1:3306java1
username=root
password=root

applicationContext.xml中






虽然数据可以映射到,但导致拿出数据的时候报错org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database
原因是c3p0取数据时没有取到一个jdbc开头的字段,导致无法匹配。
解决办法:
properties文件中
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://127.0.0.1:3306/java1
jdbc.username=root
jdbc.password=root

applicationContext.xml中






你可能感兴趣的:(前端开发,c3p0配置,c3p0数据报错,无法连接到数据库)