{"record":{"id":"7956c5777ab64f71","repo":"hibernate/hibernate-orm","slug":"the-jdbc-driver-does-not-implement-the-method-m-7956c5","errorCode":null,"errorMessage":"The JDBC driver does not implement the method: ${method}","messagePattern":"The JDBC driver does not implement the method: (.+?)","errorType":"exception","errorClass":"HibernateException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/engine/jdbc/proxy/SerializableClobProxy.java","lineNumber":63,"sourceCode":"\tpublic Clob getWrappedClob() {\n\t\tif ( clob == null ) {\n\t\t\tthrow new IllegalStateException( \"Clobs may not be accessed after serialization\" );\n\t\t}\n\t\telse {\n\t\t\treturn clob;\n\t\t}\n\t}\n\n\t@Override\n\tpublic Object invoke(Object proxy, Method method, Object[] args) throws Throwable {\n\t\tif ( \"getWrappedClob\".equals( method.getName() ) ) {\n\t\t\treturn getWrappedClob();\n\t\t}\n\t\ttry {\n\t\t\treturn method.invoke( getWrappedClob(), args );\n\t\t}\n\t\tcatch ( AbstractMethodError e ) {\n\t\t\tthrow new HibernateException( \"The JDBC driver does not implement the method: \" + method, e );\n\t\t}\n\t\tcatch ( InvocationTargetException e ) {\n\t\t\tthrow e.getTargetException();\n\t\t}\n\t}\n\n\t/**\n\t * Generates a SerializableClobProxy proxy wrapping the provided Clob object.\n\t *\n\t * @param clob The Clob to wrap.\n\t * @return The generated proxy.\n\t */\n\tpublic static Clob generateProxy(Clob clob) {\n\t\treturn (Clob) Proxy.newProxyInstance( getProxyClassLoader(), PROXY_INTERFACES, new SerializableClobProxy( clob ) );\n\t}\n\n\t/**\n\t * Determines the appropriate class loader to which the generated proxy","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/engine/jdbc/proxy/SerializableClobProxy.java#L45-L81","documentation":"SerializableClobProxy.invoke() reflectively forwards every Clob method to the wrapped driver Clob. If the driver's Clob implementation lacks the requested method - the hallmark of pre-JDBC-4 drivers - reflection raises AbstractMethodError, which this handler rethrows as HibernateException(\"The JDBC driver does not implement the method: ...\") with the method name appended. The failure indicates a driver/JDBC-level mismatch, not bad Clob data.","triggerScenarios":"Calling Clob.free() (JDBC 4.0) or getCharacterStream(long, long) (JDBC 4.1) on legacy drivers (ojdbc14, Connector/J 3.x/5.0, jTDS, JDBC-ODBC bridge); running Hibernate 6, which exercises JDBC 4 surfaces, against an old driver jar left on the classpath.","commonSituations":"Framework or JDK upgrades without a matching driver upgrade; multiple driver versions on the classpath with the legacy one winning; niche databases whose JDBC drivers lag behind the spec.","solutions":["Upgrade to a JDBC 4+ driver matching your database version","Purge old driver jars from WEB-INF/lib and the app-server lib directories","Check connection.getMetaData().getJDBCMajorVersion() >= 4 at startup and fail configuration early","Short-term: unwrap via ((WrappedClob) proxy).getWrappedClob() and avoid the unimplemented methods"],"exampleFix":"// before: legacy driver\nfree(clob); // HibernateException: The JDBC driver does not implement the method: free\n\n// after: upgrade driver, guard on capability\nif (connection.getMetaData().getJDBCMajorVersion() >= 4) {\n    clob.free();\n}","handlingStrategy":"validation","validationCode":"static boolean driverSupportsJdbc4(java.sql.Connection c) throws SQLException {\n    return c.getMetaData().getJDBCMajorVersion() >= 4;\n}\n// usage: if (driverSupportsJdbc4(conn)) clob.free(); else /* rely on statement close */","typeGuard":null,"tryCatchPattern":"try {\n    clob.free();\n} catch (org.hibernate.HibernateException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"The JDBC driver does not implement\")) {\n        stmt.close();                                // legacy driver: free via statement close\n    } else {\n        throw e;\n    }\n}","preventionTips":["Fail fast at startup if getMetaData().getJDBCMajorVersion() < 4","Upgrade the driver together with Hibernate/JDK upgrades - never separately","Scan for duplicate legacy driver jars on app-server and application classpaths"],"tags":["hibernate","jdbc","clob","driver","abstract-method-error","version-mismatch","reflection"],"backgroundTag":"jdbc-driver-unsupported-operation","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}