diff --git a/code/src/main/java/org/jacuzzi/core/PreparedStatementUtil.java b/code/src/main/java/org/jacuzzi/core/PreparedStatementUtil.java index 5d861aa..36c1b31 100644 --- a/code/src/main/java/org/jacuzzi/core/PreparedStatementUtil.java +++ b/code/src/main/java/org/jacuzzi/core/PreparedStatementUtil.java @@ -328,15 +328,27 @@ private static T runAndReturn(Invokable invokable) throws SQLException { static Object prepareResultSetGetObject(Object object) { if (object == null) { return null; - } - - if (object instanceof BigInteger) { + } else if (object instanceof BigInteger) { BigInteger bigInteger = (BigInteger) object; try { object = bigInteger.longValueExact(); } catch (ArithmeticException ignored) { // No operations. } + } else if (object instanceof Blob) { + Blob blob = (Blob) object; + try { + object = blob.getBytes(1, (int) blob.length()); + } catch (SQLException e) { + throw new DatabaseException("Can't read blob.", e); + } + } else if (object instanceof Clob) { + Clob clob = (Clob) object; + try { + object = clob.getSubString(1, (int) clob.length()); + } catch (SQLException e) { + throw new DatabaseException("Can't read clob.", e); + } } return object;