diff --git a/jOOQ/src/main/java/org/jooq/impl/BlobBinding.java b/jOOQ/src/main/java/org/jooq/impl/BlobBinding.java index 1aa5c469f2..462b49a264 100644 --- a/jOOQ/src/main/java/org/jooq/impl/BlobBinding.java +++ b/jOOQ/src/main/java/org/jooq/impl/BlobBinding.java @@ -39,7 +39,6 @@ package org.jooq.impl; import static org.jooq.impl.DefaultExecuteContext.localConnection; import static org.jooq.impl.DefaultExecuteContext.localTargetConnection; -import static org.jooq.tools.reflect.Reflect.on; import java.sql.Blob; import java.sql.SQLException; @@ -53,9 +52,9 @@ import org.jooq.BindingRegisterContext; import org.jooq.BindingSQLContext; import org.jooq.BindingSetSQLOutputContext; import org.jooq.BindingSetStatementContext; -import org.jooq.Configuration; import org.jooq.Converter; import org.jooq.Converters; +import org.jooq.ResourceManagingScope; import org.jooq.tools.jdbc.JDBCUtils; // ... @@ -93,12 +92,12 @@ public class BlobBinding implements Binding { @Override public final void set(BindingSetStatementContext ctx) throws SQLException { - ctx.statement().setBlob(ctx.index(), ctx.autoFree(newBlob(ctx.configuration(), ctx.value()))); + ctx.statement().setBlob(ctx.index(), newBlob(ctx, ctx.value())); } @Override public final void set(BindingSetSQLOutputContext ctx) throws SQLException { - ctx.output().writeBlob(ctx.autoFree(newBlob(ctx.configuration(), ctx.value()))); + ctx.output().writeBlob(newBlob(ctx, ctx.value())); } @Override @@ -137,10 +136,12 @@ public class BlobBinding implements Binding { } } - private final Blob newBlob(Configuration configuration, byte[] bytes) throws SQLException { + static final Blob newBlob(ResourceManagingScope scope, byte[] bytes) throws SQLException { Blob blob; - switch (configuration.family()) { + switch (scope.dialect()) { + + @@ -156,6 +157,7 @@ public class BlobBinding implements Binding { } } + scope.autoFree(blob); blob.setBytes(1, bytes); return blob; } diff --git a/jOOQ/src/main/java/org/jooq/impl/ClobBinding.java b/jOOQ/src/main/java/org/jooq/impl/ClobBinding.java index 6d734d9178..f12dad0ae7 100644 --- a/jOOQ/src/main/java/org/jooq/impl/ClobBinding.java +++ b/jOOQ/src/main/java/org/jooq/impl/ClobBinding.java @@ -39,7 +39,6 @@ package org.jooq.impl; import static org.jooq.impl.DefaultExecuteContext.localConnection; import static org.jooq.impl.DefaultExecuteContext.localTargetConnection; -import static org.jooq.tools.reflect.Reflect.on; import java.sql.Clob; import java.sql.SQLException; @@ -53,9 +52,9 @@ import org.jooq.BindingRegisterContext; import org.jooq.BindingSQLContext; import org.jooq.BindingSetSQLOutputContext; import org.jooq.BindingSetStatementContext; -import org.jooq.Configuration; import org.jooq.Converter; import org.jooq.Converters; +import org.jooq.ResourceManagingScope; import org.jooq.tools.jdbc.JDBCUtils; // ... @@ -93,12 +92,12 @@ public class ClobBinding implements Binding { @Override public final void set(BindingSetStatementContext ctx) throws SQLException { - ctx.statement().setClob(ctx.index(), ctx.autoFree(newClob(ctx.configuration(), ctx.value()))); + ctx.statement().setClob(ctx.index(), newClob(ctx, ctx.value())); } @Override public final void set(BindingSetSQLOutputContext ctx) throws SQLException { - ctx.output().writeClob(ctx.autoFree(newClob(ctx.configuration(), ctx.value()))); + ctx.output().writeClob(newClob(ctx, ctx.value())); } @Override @@ -137,10 +136,12 @@ public class ClobBinding implements Binding { } } - private final Clob newClob(Configuration configuration, String string) throws SQLException { + static final Clob newClob(ResourceManagingScope scope, String string) throws SQLException { Clob clob; - switch (configuration.family()) { + switch (scope.dialect()) { + + @@ -156,6 +157,7 @@ public class ClobBinding implements Binding { } } + scope.autoFree(clob); clob.setString(1, string); return clob; } diff --git a/jOOQ/src/main/java/org/jooq/impl/DefaultBinding.java b/jOOQ/src/main/java/org/jooq/impl/DefaultBinding.java index 270bab114a..aaee6fc68b 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DefaultBinding.java +++ b/jOOQ/src/main/java/org/jooq/impl/DefaultBinding.java @@ -219,7 +219,6 @@ import org.jooq.tools.jdbc.JDBCUtils; import org.jooq.tools.jdbc.MockArray; import org.jooq.tools.jdbc.MockResultSet; import org.jooq.tools.reflect.Reflect; -import org.jooq.tools.reflect.ReflectException; import org.jooq.types.DayToSecond; import org.jooq.types.UByte; import org.jooq.types.UInteger; @@ -1928,22 +1927,6 @@ public class DefaultBinding implements Binding { - - - - - - - - - - - - - - - - @@ -3834,22 +3817,6 @@ public class DefaultBinding implements Binding { - - - - - - - - - - - - - - - - @@ -3945,22 +3912,6 @@ public class DefaultBinding implements Binding { - - - - - - - - - - - - - - - - diff --git a/pom.xml b/pom.xml index d43deffa78..7e05bca552 100644 --- a/pom.xml +++ b/pom.xml @@ -34,7 +34,7 @@ 42.2.19 - 9.2.1.jre11 + 9.2.1.jre8 21.1.0.0