[jOOQ/jOOQ#11740] Stop using deprecated ojdbc API
This commit is contained in:
parent
bf531df8f2
commit
4f17f0ea29
@ -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<byte[], byte[]> {
|
||||
|
||||
@Override
|
||||
public final void set(BindingSetStatementContext<byte[]> 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<byte[]> 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<byte[], byte[]> {
|
||||
}
|
||||
}
|
||||
|
||||
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<byte[], byte[]> {
|
||||
}
|
||||
}
|
||||
|
||||
scope.autoFree(blob);
|
||||
blob.setBytes(1, bytes);
|
||||
return blob;
|
||||
}
|
||||
|
||||
@ -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<String, String> {
|
||||
|
||||
@Override
|
||||
public final void set(BindingSetStatementContext<String> 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<String> 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<String, String> {
|
||||
}
|
||||
}
|
||||
|
||||
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<String, String> {
|
||||
}
|
||||
}
|
||||
|
||||
scope.autoFree(clob);
|
||||
clob.setString(1, string);
|
||||
return clob;
|
||||
}
|
||||
|
||||
@ -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<T, U> implements Binding<T, U> {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -3834,22 +3817,6 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -3945,22 +3912,6 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
2
pom.xml
2
pom.xml
@ -34,7 +34,7 @@
|
||||
|
||||
<!-- JDBC drivers for jOOQ-xyz-extensions modules and vendor-specific API access -->
|
||||
<postgres.version>42.2.19</postgres.version>
|
||||
<sqlserver.version>9.2.1.jre11</sqlserver.version>
|
||||
<sqlserver.version>9.2.1.jre8</sqlserver.version>
|
||||
<oracle.version>21.1.0.0</oracle.version>
|
||||
|
||||
<!-- From JDK 11 onwards, we need to depend on the JAXB API explicitly -->
|
||||
|
||||
Loading…
Reference in New Issue
Block a user