Mercurial > hg > monetdb-java
diff src/main/java/nl/cwi/monetdb/jdbc/MonetClob.java @ 327:ca6a4b02d418
Add optimisation for MonetClob.getSubString(pos, length) in case the whole string is requested.
This case is used by MonetPreparedStatement.setClob(int parameterIndex, Clob x).
author | Martin van Dinther <martin.van.dinther@monetdbsolutions.com> |
---|---|
date | Thu, 12 Sep 2019 18:55:43 +0200 (2019-09-12) |
parents | d479475888e3 |
children | 54137aeb1f92 |
line wrap: on
line diff
--- a/src/main/java/nl/cwi/monetdb/jdbc/MonetClob.java +++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetClob.java @@ -124,6 +124,10 @@ public final class MonetClob implements @Override public String getSubString(final long pos, final int length) throws SQLException { checkBufIsNotNull(); + if (pos == 1L && length == buf.length()) { + // the whole string is requested + return buf.toString(); + } if (pos < 1 || pos > buf.length()) { throw new SQLException("Invalid pos value: " + pos, "M1M05"); }