Class DbStatement

    • Method Detail

      • buildRunnableForPreparedStatement

        public static JdbcRunnable buildRunnableForPreparedStatement​(Connection conn,
                                                                     String sql,
                                                                     List<String> nameOfColumns,
                                                                     DataRow dataRow,
                                                                     JdbcVoidFunction<? super PreparedStatement> executor)
        Builds runnable to set-up PreparedStatement and fed it to void function.
        Parameters:
        conn - The connection of database(won't be closed in the lambda)
        sql - The SQL for executing statement
        nameOfColumns - The sequence of columns used to call setXXX() of statement
        dataRow - The data to be set into statement
        executor - The executor for built statement
        Returns:
        The instance of lambda
      • buildSupplierForPreparedStatement

        public static <T> JdbcSupplier<T> buildSupplierForPreparedStatement​(Connection conn,
                                                                            String sql,
                                                                            List<String> nameOfColumns,
                                                                            DataRow dataRow,
                                                                            JdbcFunction<? super PreparedStatement,​? extends T> supplier)
        Builds supplier to set-up PreparedStatement and fed it to function.
        Type Parameters:
        T - The type of returned value
        Parameters:
        conn - The connection of database(won't be closed in the lambda)
        sql - The SQL for executing statement
        nameOfColumns - The sequence of columns used to call setXXX() of statement
        dataRow - The data to be set into statement
        supplier - The supplier for built statement
        Returns:
        The instance of lambda
      • buildRunnableForStatement

        public static JdbcRunnable buildRunnableForStatement​(Connection conn,
                                                             JdbcVoidFunction<? super Statement> executor)
        Builds runnable to set-up Statement and fed it to void function.
        Parameters:
        conn - The connection of database(won't be closed in the lambda)
        executor - The executor for built statement
        Returns:
        The instance of lambda
      • buildSupplierForStatement

        public static <T> JdbcSupplier<T> buildSupplierForStatement​(Connection conn,
                                                                    JdbcFunction<? super Statement,​? extends T> supplier)
        Builds supplier to set-up Statement and fed it to function.
        Type Parameters:
        T - The type of returned value
        Parameters:
        conn - The connection of database(won't be closed in the lambda)
        supplier - The supplier for built statement
        Returns:
        The instance of lambda