Package io.vertx.mutiny.sqlclient
Class PreparedStatement
java.lang.Object
io.vertx.mutiny.sqlclient.PreparedStatement
- All Implemented Interfaces:
MutinyDelegate
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.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPreparedStatement
(io.vertx.sqlclient.PreparedStatement delegate) PreparedStatement
(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.Uni<Void>
close()
Likeclose()
but notifies thecompletionHandler
when it's closed.Blocking variant ofclose()
.void
Variant ofclose()
that ignores the result of the operation.createStream
(int fetch) createStream
(int fetch, Tuple args) cursor()
boolean
io.vertx.sqlclient.PreparedStatement
int
hashCode()
static PreparedStatement
newInstance
(io.vertx.sqlclient.PreparedStatement arg) query()
toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
PreparedStatement
public PreparedStatement(io.vertx.sqlclient.PreparedStatement delegate) -
PreparedStatement
-
-
Method Details
-
getDelegate
public io.vertx.sqlclient.PreparedStatement getDelegate()- Specified by:
getDelegate
in interfaceMutinyDelegate
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
query
- Returns:
- the prepared query
-
cursor
- Returns:
-
cursor
- Parameters:
args
- the list of arguments- Returns:
- the query
-
createStream
- Parameters:
fetch
-- Returns:
-
createStream
- Parameters:
fetch
- the cursor fetch sizeargs
- the prepared query arguments- Returns:
- the createStream
-
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
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
-