How to remove invalid database connection from pool

后端 未结 4 1978
广开言路
广开言路 2021-02-08 06:22

I am using connection pooling of tomcat with oracle database. It is working fine, but when i use my application after a long time it is giving

4条回答
  •  抹茶落季
    2021-02-08 07:01

    I used validatationquery while configuring the datasource in server.xml file. It is going to check the validity of the connection by executing the query at database before giving to the application.

    for Oracle

    validationQuery="/* select 1 from dual */"
    

    for MySql

    validationQuery="/* ping */"
    

提交回复
热议问题