Package io.vertx.rxjava3.sqlclient
Class PreparedStatement
- java.lang.Object
-
- io.vertx.rxjava3.sqlclient.PreparedStatement
-
public class PreparedStatement extends Object
A prepared statement, the statement is pre-compiled and it's more efficient to execute the statement for multiple times. In addition, this kind of statement provides protection against SQL injection attacks.From a prepared statement you can
- use
query()to create and execute aPreparedQuery - use
cursor()to create aCursor - use
createStream(int)to create aRowStream
originalnon RX-ified interface using Vert.x codegen. - use
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<PreparedStatement>__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description PreparedStatement(PreparedStatement delegate)PreparedStatement(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.reactivex.rxjava3.core.Completableclose()Likeclose()but notifies thecompletionHandlerwhen it's closed.RowStream<Row>createStream(int fetch)LikecreateStream(int)but with empty arguments.RowStream<Row>createStream(int fetch, Tuple args)Execute the prepared query with a cursor and createStream the result.Cursorcursor()Likecursor()but with empty arguments.Cursorcursor(Tuple args)Create a cursor with the providedarguments.booleanequals(Object o)PreparedStatementgetDelegate()inthashCode()static PreparedStatementnewInstance(PreparedStatement arg)PreparedQuery<RowSet<Row>>query()Create a prepared query for this statement.io.reactivex.rxjava3.core.CompletablerxClose()Likeclose()but notifies thecompletionHandlerwhen it's closed.StringtoString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<PreparedStatement> __TYPE_ARG
-
-
Constructor Detail
-
PreparedStatement
public PreparedStatement(PreparedStatement delegate)
-
PreparedStatement
public PreparedStatement(Object delegate)
-
-
Method Detail
-
getDelegate
public PreparedStatement getDelegate()
-
query
public PreparedQuery<RowSet<Row>> query()
Create a prepared query for this statement.- Returns:
- the prepared query
-
cursor
public Cursor cursor(Tuple args)
Create a cursor with the providedarguments.- Parameters:
args- the list of arguments- Returns:
- the query
-
createStream
public RowStream<Row> createStream(int fetch)
LikecreateStream(int)but with empty arguments.- Parameters:
fetch-- Returns:
-
createStream
public RowStream<Row> createStream(int fetch, Tuple args)
Execute the prepared query with a cursor and createStream the result. The createStream opens a cursor with afetchsize to fetch the results. Note: this requires to be in a transaction, since cursors require it.- Parameters:
fetch- the cursor fetch sizeargs- the prepared query arguments- Returns:
- the createStream
-
close
public io.reactivex.rxjava3.core.Completable close()
Likeclose()but notifies thecompletionHandlerwhen it's closed.- Returns:
-
rxClose
public io.reactivex.rxjava3.core.Completable rxClose()
Likeclose()but notifies thecompletionHandlerwhen it's closed.- Returns:
-
newInstance
public static PreparedStatement newInstance(PreparedStatement arg)
-
-