Top Description Fields Constructors Methods
org.jooq.tools.r2dbc

public Class LoggingStatement

extends DefaultStatement
Class Inheritance
Imports
org.jooq.tools.JooqLogger, org.reactivestreams.Publisher, io.r2dbc.spi.Result, .Statement

An R2DBC Statement proxy that logs all statements that are prepared or executed using it.
Author
Lukas Eder

Field Summary

Modifier and TypeField and Description
private static final JooqLogger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Statement
add()

Overrides org.jooq.tools.r2dbc.DefaultStatement.add.

Implements io.r2dbc.spi.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 bind and bindNull.
public Statement
bind(int
the index to bind to
index
,
Object
the value to bind
value
)

Overrides org.jooq.tools.r2dbc.DefaultStatement.bind.

Implements io.r2dbc.spi.Statement.bind.

Bind a non-null value to an indexed parameter.
public Statement
bind(String
the name of identifier to bind to
name
,
Object
the value to bind
value
)

Overrides org.jooq.tools.r2dbc.DefaultStatement.bind.

Implements io.r2dbc.spi.Statement.bind.

Bind a non-null to a named parameter.
public Statement
bindNull(int
the index to bind to
index
,
Class<?>
the type of null value
type
)

Overrides org.jooq.tools.r2dbc.DefaultStatement.bindNull.

Implements io.r2dbc.spi.Statement.bindNull.

Bind a null value to an indexed parameter.
public Statement
bindNull(String
the name of identifier to bind to
name
,
Class<?>
the type of null value
type
)

Overrides org.jooq.tools.r2dbc.DefaultStatement.bindNull.

Implements io.r2dbc.spi.Statement.bindNull.

Bind a null value to a named parameter.
public Publisher<? extends Result>
execute()

Overrides org.jooq.tools.r2dbc.DefaultStatement.execute.

Implements io.r2dbc.spi.Statement.execute.

Executes one or more SQL statements and returns the Results.
Inherited from org.jooq.tools.r2dbc.DefaultStatement:
fetchSizegetDelegatereturnGeneratedValues

Field Detail

logback to summary
private static final JooqLogger log

Constructor Detail

LoggingStatementback to summary
public LoggingStatement(Statement delegate)

Method Detail

addback to summary
public Statement add()

Overrides org.jooq.tools.r2dbc.DefaultStatement.add.

Implements io.r2dbc.spi.Statement.add.

Doc from io.r2dbc.spi.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 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();
Returns:Statement

this Statement

Annotations
@Override
bindback to summary
public Statement bind(int index, Object value)

Overrides org.jooq.tools.r2dbc.DefaultStatement.bind.

Implements io.r2dbc.spi.Statement.bind.

Doc from io.r2dbc.spi.Statement.bind.

Bind a non-null value to an indexed parameter. Indexes are zero-based.

Parameters
index:int

the index to bind to

value:Object

the value to bind

Returns:Statement

this Statement

Annotations
@Override
bindback to summary
public Statement bind(String name, Object value)

Overrides org.jooq.tools.r2dbc.DefaultStatement.bind.

Implements io.r2dbc.spi.Statement.bind.

Doc from io.r2dbc.spi.Statement.bind.

Bind a non-null to a named parameter.

Parameters
name:String

the name of identifier to bind to

value:Object

the value to bind

Returns:Statement

this Statement

Annotations
@Override
bindNullback to summary
public Statement bindNull(int index, Class<?> type)

Overrides org.jooq.tools.r2dbc.DefaultStatement.bindNull.

Implements io.r2dbc.spi.Statement.bindNull.

Doc from io.r2dbc.spi.Statement.bindNull.

Bind a null value to an indexed parameter. Indexes are zero-based.

Parameters
index:int

the index to bind to

type:Class<?>

the type of null value

Returns:Statement

this Statement

Annotations
@Override
bindNullback to summary
public Statement bindNull(String name, Class<?> type)

Overrides org.jooq.tools.r2dbc.DefaultStatement.bindNull.

Implements io.r2dbc.spi.Statement.bindNull.

Doc from io.r2dbc.spi.Statement.bindNull.

Bind a null value to a named parameter.

Parameters
name:String

the name of identifier to bind to

type:Class<?>

the type of null value

Returns:Statement

this Statement

Annotations
@Override
executeback to summary
public Publisher<? extends Result> execute()

Overrides org.jooq.tools.r2dbc.DefaultStatement.execute.

Implements io.r2dbc.spi.Statement.execute.

Doc from io.r2dbc.spi.Statement.execute.

Executes one or more SQL statements and returns the 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().

Returns:Publisher<? extends Result>

the Results, returned by each statement

Annotations
@Override