Class BasicBinder<J>

  • All Implemented Interfaces:
    ValueBinder<J>

    public abstract class BasicBinder<J>
    extends java.lang.Object
    implements ValueBinder<J>
    Convenience base implementation of ValueBinder
    • Method Detail

      • bind

        public final void bind​(java.sql.PreparedStatement st,
                               J value,
                               int index,
                               WrapperOptions options)
                        throws java.sql.SQLException
        Description copied from interface: ValueBinder
        Bind a value to a prepared statement.
        Specified by:
        bind in interface ValueBinder<J>
        Parameters:
        st - The prepared statement to which to bind the value.
        value - The value to bind.
        index - The position at which to bind the value within the prepared statement
        options - The options.
        Throws:
        java.sql.SQLException - Indicates a JDBC error occurred.
      • bind

        public final void bind​(java.sql.CallableStatement st,
                               J value,
                               java.lang.String name,
                               WrapperOptions options)
                        throws java.sql.SQLException
        Description copied from interface: ValueBinder
        Bind a value to a CallableStatement.
        Specified by:
        bind in interface ValueBinder<J>
        Parameters:
        st - The prepared statement to which to bind the value.
        value - The value to bind.
        name - The name to bind the value within the prepared statement
        options - The options.
        Throws:
        java.sql.SQLException - Indicates a JDBC error occurred.
      • doBind

        protected abstract void doBind​(java.sql.PreparedStatement st,
                                       J value,
                                       int index,
                                       WrapperOptions options)
                                throws java.sql.SQLException
        Perform the binding. Safe to assume that value is not null.
        Parameters:
        st - The prepared statement
        value - The value to bind (not null).
        index - The index at which to bind
        options - The binding options
        Throws:
        java.sql.SQLException - Indicates a problem binding to the prepared statement.
      • doBind

        protected abstract void doBind​(java.sql.CallableStatement st,
                                       J value,
                                       java.lang.String name,
                                       WrapperOptions options)
                                throws java.sql.SQLException
        Perform the binding. Safe to assume that value is not null.
        Parameters:
        st - The CallableStatement
        value - The value to bind (not null).
        name - The name at which to bind
        options - The binding options
        Throws:
        java.sql.SQLException - Indicates a problem binding to the prepared statement.