美文网首页
解决使用c3p0连接池,mysql如果8小时未连接报错问题

解决使用c3p0连接池,mysql如果8小时未连接报错问题

作者: G__yuan | 来源:发表于2019-07-10 09:36 被阅读0次

    1.用c3p0解决mysql8小时问题

    问题:用c3p0解决mysql8小时问题报错,原因是无效的属性的driverClassName和username,以下是报错内容:

    Invalid property 'driverClassName' of bean class [com.mchange.v2.c3p0.ComboPooledDataSource]: Bean property 'driverClassName' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

    解决方案是:把原来的driverClassName改成driverClass,username改成user,因为在c3p0数据源的里面没有driverClassName和username这两个属性。

    com.mchange.v2.c3p0.ComboPooledDataSource这个包中只有这两个属性driverClass和user。

    相关文章

      网友评论

          本文标题:解决使用c3p0连接池,mysql如果8小时未连接报错问题

          本文链接:https://www.haomeiwen.com/subject/rizxkctx.html