Class InputStreamArgument

  • All Implemented Interfaces:
    Argument

    public class InputStreamArgument
    extends java.lang.Object
    implements Argument
    Bind an input stream as either an ASCII (discouraged) or binary stream.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean ascii  
      private int length  
      private java.io.InputStream value  
    • Constructor Summary

      Constructors 
      Constructor Description
      InputStreamArgument​(java.io.InputStream stream, int length, boolean ascii)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void apply​(int position, java.sql.PreparedStatement statement, StatementContext ctx)
      Apply the argument to the given prepared statement.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • value

        private final java.io.InputStream value
      • length

        private final int length
      • ascii

        private final boolean ascii
    • Constructor Detail

      • InputStreamArgument

        public InputStreamArgument​(java.io.InputStream stream,
                                   int length,
                                   boolean ascii)
        Parameters:
        stream - the stream to bind
        length - the length of the stream
        ascii - true if the stream is ASCII
    • Method Detail

      • apply

        public void apply​(int position,
                          java.sql.PreparedStatement statement,
                          StatementContext ctx)
                   throws java.sql.SQLException
        Description copied from interface: Argument
        Apply the argument to the given prepared statement.
        Specified by:
        apply in interface Argument
        Parameters:
        position - the position to which the argument should be bound, using the stupid JDBC "start at 1" bit
        statement - the prepared statement the argument is to be bound to
        ctx - the statement context
        Throws:
        java.sql.SQLException - if anything goes wrong
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object