| Modifier and Type | Method and Description | 
|---|---|
| Statement | add()Save the current binding and create a new one to indicate the statement should be executed again with new bindings provided through subsequent calls to  bindandbindNull. | 
| Statement | bind(int index,
    Object value)Bind a non- nullvalue to an indexed parameter. | 
| Statement | bind(String name,
    Object value)Bind a non- nullto a named parameter. | 
| Statement | bindNull(int index,
        Class<?> type)Bind a  nullvalue to an indexed parameter. | 
| Statement | bindNull(String name,
        Class<?> type)Bind a  nullvalue to a named parameter. | 
| Publisher<? extends Result> | execute()Executes one or more SQL statements and returns the  Results. | 
| default Statement | fetchSize(int rows)Configures  Statementto retrieve a fixed number of rows when fetching results from a query instead deriving fetch size from back pressure. | 
| default Statement | returnGeneratedValues(String... columns) | 
Statement add()
bind and bindNull.
 For example:
 
 Statement statement = connection.createStatement("INSERT INTO books (author, publisher) VALUES ($1, $2)");
 statement.bind(0, "John Doe").bind(1, "Happy Books LLC").add();
 statement.bind(0, "Jane Doe").bind(1, "Scary Books Inc");
 statement.execute();
 StatementIllegalStateException - if the statement is parametrized and not all parameter values are providedStatement bind(int index, Object value)
null value to an indexed parameter.  Indexes are zero-based.index - the index to bind tovalue - the value to bindStatementIllegalArgumentException - if value is nullIndexOutOfBoundsException - if the parameter index is out of rangeStatement bind(String name, Object value)
null to a named parameter.name - the name of identifier to bind tovalue - the value to bindStatementIllegalArgumentException - if name or value is nullNoSuchElementException - if name is not a known name to bindStatement bindNull(int index, Class<?> type)
null value to an indexed parameter.  Indexes are zero-based.index - the index to bind totype - the type of null valueStatementIllegalArgumentException - if type is nullIndexOutOfBoundsException - if the parameter index is out of rangeStatement bindNull(String name, Class<?> type)
null value to a named parameter.name - the name of identifier to bind totype - the type of null valueStatementIllegalArgumentException - if name or type is nullNoSuchElementException - if name is not a known name to bindPublisher<? extends Result> execute()
Results.
 Result objects must be fully consumed to ensure full execution of the Statement.
 This statement is executed additionally for each binding saved through add().Results, returned by each statementIllegalStateException - if the statement is parametrized and not all parameter values are provideddefault Statement returnGeneratedValues(String... columns)
Statement to return the generated values from any rows created by this Statement in the Result returned from execute().  If no columns are specified,
 implementations are free to choose which columns will be returned.  If called multiple times, only the columns requested in the final invocation will be returned.
 The default implementation of this method is a no-op.
columns - the names of the columns to returnStatementIllegalArgumentException - if columns, or any item in columns is nulldefault Statement fetchSize(int rows)
Statement to retrieve a fixed number of rows when fetching results from a query instead deriving fetch size from back pressure.  If called multiple times, only the fetch
 size configured in the final invocation will be applied.  If the value specified is zero, then the hint is ignored.
 The default implementation of this method is a no op and the default value is zero.
rows - the number of rows to fetchStatementCopyright © 2021. All rights reserved.