{"record":{"id":"cbb8bf0f3b3dfbfd","repo":"hibernate/hibernate-orm","slug":"the-jdbc-driver-does-not-implement-the-method-m","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/SerializableBlobProxy.java","lineNumber":63,"sourceCode":"\tpublic Blob getWrappedBlob() {\n\t\tif ( blob == null ) {\n\t\t\tthrow new IllegalStateException( \"Blobs may not be accessed after serialization\" );\n\t\t}\n\t\telse {\n\t\t\treturn blob;\n\t\t}\n\t}\n\n\t@Override\n\tpublic Object invoke(Object proxy, Method method, Object[] args) throws Throwable {\n\t\tif ( \"getWrappedBlob\".equals( method.getName() ) ) {\n\t\t\treturn getWrappedBlob();\n\t\t}\n\t\ttry {\n\t\t\treturn method.invoke( getWrappedBlob(), 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 SerializableBlob proxy wrapping the provided Blob object.\n\t *\n\t * @param blob The Blob to wrap.\n\t *\n\t * @return The generated proxy.\n\t */\n\tpublic static Blob generateProxy(Blob blob) {\n\t\treturn (Blob) Proxy.newProxyInstance( getProxyClassLoader(), PROXY_INTERFACES, new SerializableBlobProxy( blob ) );\n\t}\n\n\t/**","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/engine/jdbc/proxy/SerializableBlobProxy.java#L45-L81","documentation":"SerializableBlobProxy.invoke() forwards every Blob method to the wrapped driver Blob via reflection. When the driver's Blob implementation simply does not implement the requested method (typical for pre-JDBC-4 drivers), reflection raises AbstractMethodError, which the proxy converts to HibernateException(\"The JDBC driver does not implement the method: ...\") naming the failing method. It is a driver-capability problem, not a data problem.","triggerScenarios":"Calling Blob.free() (JDBC 4.0) or getBinaryStream(long, long) (JDBC 4.1) on drivers such as ojdbc14, MySQL Connector/J 3.x/5.0, jTDS, or the JDBC-ODBC bridge; mixing an upgraded application (Hibernate 6 requires JDBC 4.x surfaces) with a stale driver jar still on the classpath.","commonSituations":"Upgrading Hibernate/app server while the old driver jar remains in WEB-INF/lib or the server lib directory; JDK upgrades (Java 8 -> 17) where the old driver no longer matches; transitive dependencies pulling in legacy drivers; internal drivers that never implemented later JDBC Blob methods.","solutions":["Upgrade the JDBC driver to a JDBC 4+ build matching your database (ojdbc11, mysql-connector-j 8.x+, mssql-jdbc 12.x, postgresql 42.x)","Remove conflicting old driver jars from the classpath so the new one actually loads","Verify the driver's level with connection.getMetaData().getJDBCMajorVersion() (need >= 4)","As a stopgap, unwrap the raw Blob via ((WrappedBlob) proxy).getWrappedBlob() and restrict yourself to methods the driver implements"],"exampleFix":"// before: old driver, JDBC 4 method\nblob.free(); // HibernateException: The JDBC driver does not implement the method: free\n\n// after: upgrade driver, then verify\nint major = connection.getMetaData().getJDBCMajorVersion(); // >= 4\nif (major >= 4) blob.free();","handlingStrategy":"validation","validationCode":"static boolean driverSupportsJdbc4(java.sql.Connection c) throws SQLException {\n    return c.getMetaData().getJDBCMajorVersion() >= 4;\n}\n// usage: if (driverSupportsJdbc4(conn)) blob.free(); else /* legacy driver: skip, close statement instead */","typeGuard":null,"tryCatchPattern":"try {\n    blob.free();\n} catch (org.hibernate.HibernateException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"The JDBC driver does not implement\")) {\n        // driver predates this method: rely on statement/connection close to free resources\n        stmt.close();\n    } else {\n        throw e;\n    }\n}","preventionTips":["Assert connection.getMetaData().getJDBCMajorVersion() >= 4 at application startup","After any Hibernate/JDK upgrade, audit the classpath for stale driver jars","Keep exactly one driver version matching the database on the classpath"],"tags":["hibernate","jdbc","blob","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"}