Package io.vertx.mutiny.sqlclient
Class PreparedStatement
- java.lang.Object
-
- io.vertx.mutiny.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
original
non Mutiny-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(io.vertx.sqlclient.PreparedStatement delegate)
PreparedStatement(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.smallrye.mutiny.Uni<Void>
close()
Likeclose()
but notifies thecompletionHandler
when it's closed.Void
closeAndAwait()
Blocking variant ofclose()
.void
closeAndForget()
Variant ofclose()
that ignores the result of the operation.RowStream<Row>
createStream(int fetch)
RowStream<Row>
createStream(int fetch, Tuple args)
Cursor
cursor()
Cursor
cursor(Tuple args)
boolean
equals(Object o)
io.vertx.sqlclient.PreparedStatement
getDelegate()
int
hashCode()
static PreparedStatement
newInstance(io.vertx.sqlclient.PreparedStatement arg)
PreparedQuery<RowSet<Row>>
query()
String
toString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<PreparedStatement> __TYPE_ARG
-
-
Constructor Detail
-
PreparedStatement
public PreparedStatement(io.vertx.sqlclient.PreparedStatement delegate)
-
PreparedStatement
public PreparedStatement(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.sqlclient.PreparedStatement getDelegate()
-
query
public PreparedQuery<RowSet<Row>> query()
- Returns:
- the prepared query
-
cursor
public Cursor cursor()
- Returns:
-
cursor
public Cursor cursor(Tuple args)
- Parameters:
args
- the list of arguments- Returns:
- the query
-
createStream
public RowStream<Row> createStream(int fetch, Tuple args)
- Parameters:
fetch
- the cursor fetch sizeargs
- the prepared query arguments- Returns:
- the createStream
-
close
public io.smallrye.mutiny.Uni<Void> close()
Likeclose()
but notifies thecompletionHandler
when it's closed.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
closeAndAwait
public Void closeAndAwait()
Blocking variant ofclose()
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
closeAndForget
public void closeAndForget()
-
newInstance
public static PreparedStatement newInstance(io.vertx.sqlclient.PreparedStatement arg)
-
-