public static InputParameter bind(Supplier<InputStream> streamSupplier) { return (statement, position, closer) -> { InputStream inputStream = streamSupplier.get(); RuntimeSQLException.execute( () -> { if (inputStream == null) { statement.setNull(position, Types.BLOB); } else { closer.onClose(inputStream::close); statement.setBlob(position, inputStream); } }); }; }
public static InputParameter bind(String value) { return (statement, position, closer) -> RuntimeSQLException.execute(() -> statement.setString(position, value)); }
private static void setValue( PreparedStatement statement, int position, Object value, int sqlType) { RuntimeSQLException.execute(() -> statement.setObject(position, value, sqlType)); }
public static InputParameter bind(BigDecimal value) { return (statement, position, closer) -> RuntimeSQLException.execute(() -> statement.setBigDecimal(position, value)); }