{"record":{"id":"ba5b26b7e7a00b67","repo":"alibaba/druid","slug":"not-support","errorCode":null,"errorMessage":"not support","messagePattern":"not support","errorType":"exception","errorClass":"SQLException","httpStatus":null,"severity":"warning","filePath":"core/src/main/java/com/alibaba/druid/pool/DruidPooledStatement.java","lineNumber":871,"sourceCode":"        try {\n            return stmt.getResultSetHoldability();\n        } catch (Throwable t) {\n            throw checkException(t);\n        }\n    }\n\n    @Override\n    public final boolean isClosed() throws SQLException {\n        return closed;\n    }\n\n    @Override\n    public final void setPoolable(boolean poolable) throws SQLException {\n        if (poolable) {\n            return;\n        }\n\n        throw new SQLException(\"not support\");\n    }\n\n    @Override\n    public final boolean isPoolable() throws SQLException {\n        return false;\n    }\n\n    public String toString() {\n        return stmt.toString();\n    }\n\n    public void closeOnCompletion() throws SQLException {\n        stmt.closeOnCompletion();\n    }\n\n    public boolean isCloseOnCompletion() throws SQLException {\n        return stmt.isCloseOnCompletion();\n    }","sourceCodeStart":853,"sourceCodeEnd":889,"githubUrl":"https://github.com/alibaba/druid/blob/fa8dc9912637a2f729eef9f55356621fec18d40e/core/src/main/java/com/alibaba/druid/pool/DruidPooledStatement.java#L853-L889","documentation":"Thrown unconditionally by DruidPooledStatement.setPoolable(false). Druid's pooled statement always returns isPoolable()==false and refuses to enable pooling via setPoolable(true is a no-op, false throws), because Druid manages statement pooling itself via its PreparedStatement cache and does not delegate the JDBC poolable hint to the underlying driver. The error is a deliberate guard, not a runtime fault.","triggerScenarios":"Calling statement.setPoolable(false) on a DruidPooledStatement (or any Statement obtained from a Druid connection). ORM frameworks or generic JDBC wrappers that disable poolability on statements will hit this.","commonSituations":"Spring/JPA, Hibernate, or MyBatis wrappers that call setPoolable(false) on result-bearing statements; migration from another pool (HikariCP/DBCP) that tolerated the call; code copied from tutorials setting poolable hints.","solutions":["Remove the setPoolable(false) call — it has no useful effect under Druid and is what triggers the exception.","If a framework calls it, configure the framework to skip statement poolable hints, or wrap with a Statement that swallows the unsupported operation.","Control statement caching through Druid's own configuration (poolPreparedStatements, maxOpenPreparedStatements) instead of the JDBC poolable API."],"exampleFix":"// before\nStatement st = conn.createStatement();\nst.setPoolable(false); // throws 'not support'\n\n// after\nStatement st = conn.createStatement();\n// do not call setPoolable; Druid manages caching itself\n// configure in DataSource: poolPreparedStatements=true; maxOpenPreparedStatements=20","handlingStrategy":"validation","validationCode":"// Do not call setPoolable(false) on Druid statements.\nif (statement instanceof DruidPooledStatement) {\n    // skip; Druid does not support disabling poolable\n} else {\n    statement.setPoolable(false);\n}","typeGuard":"public static boolean supportsSetPoolable(Statement s) {\n    return !(s instanceof DruidPooledStatement);\n}","tryCatchPattern":"try {\n    stmt.setPoolable(false);\n} catch (SQLException e) {\n    if (\"not support\".equals(e.getMessage())) {\n        // expected under Druid; ignore\n    } else throw e;\n}","preventionTips":["Avoid calling setPoolable on statements when using Druid.","Configure statement caching via Druid poolPreparedStatements, not the JDBC poolable hint.","If a framework forces the call, wrap the statement to swallow the unsupported operation."],"tags":["statement","unsupported-operation","jdbc","orm-interop"],"backgroundTag":null,"analyzedSha":"fa8dc9912637a2f729eef9f55356621fec18d40e","analyzedAt":"2026-08-14T04:55:06.789Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}