コード例 #1
0
 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);
           }
         });
   };
 }
コード例 #2
0
 public static InputParameter bind(String value) {
   return (statement, position, closer) ->
       RuntimeSQLException.execute(() -> statement.setString(position, value));
 }
コード例 #3
0
 private static void setValue(
     PreparedStatement statement, int position, Object value, int sqlType) {
   RuntimeSQLException.execute(() -> statement.setObject(position, value, sqlType));
 }
コード例 #4
0
 public static InputParameter bind(BigDecimal value) {
   return (statement, position, closer) ->
       RuntimeSQLException.execute(() -> statement.setBigDecimal(position, value));
 }