Are you saying that JDBC cannot handle or process \gexec, since it is PG-15 exclusive?
JDBC cannot handle our process \gexec since it is _psql_ exclusive. It's a command interpreted and evaluated by that client specifically, not by the Postgres server.