You are using the most efficient way. I tried to look into converting the jsonb value directly to some json parser in the jdbc driver, but it turned out the the server always sends jsonb as a serialized string instead of the faster-to-parse internal jsonb storage format.
-Mikko
From: pgsql-jdbc-owner@postgresql.org <pgsql-jdbc-owner@postgresql.org> on behalf of Tom Smith <tomsmith1989sk@gmail.com> Sent: 19 August 2015 22:20 To: pgsql-jdbc@postgresql.org Subject: [JDBC] best way to convert JSONB object from result