mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-19 09:34:18 +01:00
Apply lint
This commit is contained in:
@@ -127,7 +127,8 @@ public final class JDBC4PreparedStatement extends JDBC4Statement implements Prep
|
|||||||
this.statement.bindNull(parameterIndex);
|
this.statement.bindNull(parameterIndex);
|
||||||
} else {
|
} else {
|
||||||
long time = x.getTime();
|
long time = x.getTime();
|
||||||
this.statement.bindBlob(parameterIndex, ByteBuffer.allocate(Long.BYTES).putLong(time).array());
|
this.statement.bindBlob(
|
||||||
|
parameterIndex, ByteBuffer.allocate(Long.BYTES).putLong(time).array());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +139,8 @@ public final class JDBC4PreparedStatement extends JDBC4Statement implements Prep
|
|||||||
this.statement.bindNull(parameterIndex);
|
this.statement.bindNull(parameterIndex);
|
||||||
} else {
|
} else {
|
||||||
long time = x.getTime();
|
long time = x.getTime();
|
||||||
this.statement.bindBlob(parameterIndex, ByteBuffer.allocate(Long.BYTES).putLong(time).array());
|
this.statement.bindBlob(
|
||||||
|
parameterIndex, ByteBuffer.allocate(Long.BYTES).putLong(time).array());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,7 +151,8 @@ public final class JDBC4PreparedStatement extends JDBC4Statement implements Prep
|
|||||||
this.statement.bindNull(parameterIndex);
|
this.statement.bindNull(parameterIndex);
|
||||||
} else {
|
} else {
|
||||||
long time = x.getTime();
|
long time = x.getTime();
|
||||||
this.statement.bindBlob(parameterIndex, ByteBuffer.allocate(Long.BYTES).putLong(time).array());
|
this.statement.bindBlob(
|
||||||
|
parameterIndex, ByteBuffer.allocate(Long.BYTES).putLong(time).array());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -153,16 +153,17 @@ public final class JDBC4ResultSet implements ResultSet, ResultSetMetaData {
|
|||||||
if (result == null) {
|
if (result == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return wrapTypeConversion(() -> {
|
return wrapTypeConversion(
|
||||||
if (result instanceof byte[]) {
|
() -> {
|
||||||
byte[] bytes = (byte[]) result;
|
if (result instanceof byte[]) {
|
||||||
if (bytes.length == Long.BYTES) {
|
byte[] bytes = (byte[]) result;
|
||||||
long time = ByteBuffer.wrap(bytes).getLong();
|
if (bytes.length == Long.BYTES) {
|
||||||
return new Date(time);
|
long time = ByteBuffer.wrap(bytes).getLong();
|
||||||
}
|
return new Date(time);
|
||||||
}
|
}
|
||||||
throw new SQLException("Cannot convert value to Date: " + result.getClass());
|
}
|
||||||
});
|
throw new SQLException("Cannot convert value to Date: " + result.getClass());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -172,16 +173,17 @@ public final class JDBC4ResultSet implements ResultSet, ResultSetMetaData {
|
|||||||
if (result == null) {
|
if (result == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return wrapTypeConversion(() -> {
|
return wrapTypeConversion(
|
||||||
if (result instanceof byte[]) {
|
() -> {
|
||||||
byte[] bytes = (byte[]) result;
|
if (result instanceof byte[]) {
|
||||||
if (bytes.length == Long.BYTES) {
|
byte[] bytes = (byte[]) result;
|
||||||
long time = ByteBuffer.wrap(bytes).getLong();
|
if (bytes.length == Long.BYTES) {
|
||||||
return new Time(time);
|
long time = ByteBuffer.wrap(bytes).getLong();
|
||||||
}
|
return new Time(time);
|
||||||
}
|
}
|
||||||
throw new SQLException("Cannot convert value to Date: " + result.getClass());
|
}
|
||||||
});
|
throw new SQLException("Cannot convert value to Date: " + result.getClass());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -191,16 +193,17 @@ public final class JDBC4ResultSet implements ResultSet, ResultSetMetaData {
|
|||||||
if (result == null) {
|
if (result == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return wrapTypeConversion(() -> {
|
return wrapTypeConversion(
|
||||||
if (result instanceof byte[]) {
|
() -> {
|
||||||
byte[] bytes = (byte[]) result;
|
if (result instanceof byte[]) {
|
||||||
if (bytes.length == Long.BYTES) {
|
byte[] bytes = (byte[]) result;
|
||||||
long time = ByteBuffer.wrap(bytes).getLong();
|
if (bytes.length == Long.BYTES) {
|
||||||
return new Timestamp(time);
|
long time = ByteBuffer.wrap(bytes).getLong();
|
||||||
}
|
return new Timestamp(time);
|
||||||
}
|
}
|
||||||
throw new SQLException("Cannot convert value to Timestamp: " + result.getClass());
|
}
|
||||||
});
|
throw new SQLException("Cannot convert value to Timestamp: " + result.getClass());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -284,20 +287,21 @@ public final class JDBC4ResultSet implements ResultSet, ResultSetMetaData {
|
|||||||
if (result == null) {
|
if (result == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return wrapTypeConversion(() -> {
|
return wrapTypeConversion(
|
||||||
if (result instanceof byte[]) {
|
() -> {
|
||||||
byte[] bytes = (byte[]) result;
|
if (result instanceof byte[]) {
|
||||||
if (bytes.length == Long.BYTES) {
|
byte[] bytes = (byte[]) result;
|
||||||
long time = ByteBuffer.wrap(bytes).getLong();
|
if (bytes.length == Long.BYTES) {
|
||||||
return new Date(time);
|
long time = ByteBuffer.wrap(bytes).getLong();
|
||||||
}
|
return new Date(time);
|
||||||
}
|
}
|
||||||
// Try to parse as string if it's stored as TEXT
|
}
|
||||||
if (result instanceof String) {
|
// Try to parse as string if it's stored as TEXT
|
||||||
return Date.valueOf((String) result);
|
if (result instanceof String) {
|
||||||
}
|
return Date.valueOf((String) result);
|
||||||
throw new SQLException("Cannot convert value to Date: " + result.getClass());
|
}
|
||||||
});
|
throw new SQLException("Cannot convert value to Date: " + result.getClass());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user