JAVA连接数据库报错“java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.”

JAVA连接数据库报错“java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.”

JAVA连接数据库报错“java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.”_第1张图片

解决方案:

进入c3p0-config.xml,将连接数扩大。

原始:


    
    
        
        com.mysql.jdbc.Driver
        jdbc:mysql://localhost:3306/studenttest?userSSL=false&serverTimezone=UTC&characterEncoding=utf-8
        root
        000000
        10
        
        
        10
        
        10
        
        5
        
        2000
        
        1000
    

扩大后:


    
    
        
        com.mysql.jdbc.Driver
        jdbc:mysql://localhost:3306/studenttest?userSSL=false&serverTimezone=UTC&characterEncoding=utf-8
        root
        000000
        10
        
        
        10
        
        100
        
        5
        
        2000
        
        1000
    

maxPoolSize从10扩大到100。

运行结果:

你可能感兴趣的:(java,tomcat,jar,intellij-idea)