hibernate/hibernate-orm · error · HibernateException

The JDBC driver does not implement the method: ${method}

Error message

The JDBC driver does not implement the method: ${method}

What it means

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.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/engine/jdbc/proxy/SerializableClobProxy.java:63

	public Clob getWrappedClob() {
		if ( clob == null ) {
			throw new IllegalStateException( "Clobs may not be accessed after serialization" );
		}
		else {
			return clob;
		}
	}

	@Override
	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
		if ( "getWrappedClob".equals( method.getName() ) ) {
			return getWrappedClob();
		}
		try {
			return method.invoke( getWrappedClob(), args );
		}
		catch ( AbstractMethodError e ) {
			throw new HibernateException( "The JDBC driver does not implement the method: " + method, e );
		}
		catch ( InvocationTargetException e ) {
			throw e.getTargetException();
		}
	}

	/**
	 * Generates a SerializableClobProxy proxy wrapping the provided Clob object.
	 *
	 * @param clob The Clob to wrap.
	 * @return The generated proxy.
	 */
	public static Clob generateProxy(Clob clob) {
		return (Clob) Proxy.newProxyInstance( getProxyClassLoader(), PROXY_INTERFACES, new SerializableClobProxy( clob ) );
	}

	/**
	 * Determines the appropriate class loader to which the generated proxy

View on GitHub (pinned to fad1729dce)

Solutions

  1. Upgrade to a JDBC 4+ driver matching your database version
  2. Purge old driver jars from WEB-INF/lib and the app-server lib directories
  3. Check connection.getMetaData().getJDBCMajorVersion() >= 4 at startup and fail configuration early
  4. Short-term: unwrap via ((WrappedClob) proxy).getWrappedClob() and avoid the unimplemented methods

Example fix

// before: legacy driver
free(clob); // HibernateException: The JDBC driver does not implement the method: free

// after: upgrade driver, guard on capability
if (connection.getMetaData().getJDBCMajorVersion() >= 4) {
    clob.free();
}
Defensive patterns

Strategy: validation

Validate before calling

static boolean driverSupportsJdbc4(java.sql.Connection c) throws SQLException {
    return c.getMetaData().getJDBCMajorVersion() >= 4;
}
// usage: if (driverSupportsJdbc4(conn)) clob.free(); else /* rely on statement close */

Try / catch

try {
    clob.free();
} catch (org.hibernate.HibernateException e) {
    if (e.getMessage() != null && e.getMessage().startsWith("The JDBC driver does not implement")) {
        stmt.close();                                // legacy driver: free via statement close
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22). Data as JSON: /api/errors/7956c5777ab64f71. Report an issue: GitHub.