MyBatis version
3.5.x
Database vendor and version
mysql 8
Test case or example project
since Mybatis 3.5.x, SimpleExecutor.doQueryCursor use Statement.closeOnCompletion to close Statement
when in Mybatis 3.4.x,the Statement is closed in DefaultCursor close function
when open the server prepareStatement in mysql(jdbc set useServerPrepStmts=true),closeOnCompletion cannot release mysql server resource, So result in server memory leak.
I think mybe this is mysql jdbc driver's bug, but I don't konw why to use closeOnCompletion instead of close,can mybatis to fix the bug ?
Steps to reproduce
Expected result
Actual result