Represents a connection to a SQL database
Constructor and description |
---|
SQLConnection
(java.lang.Object delegate) |
Type | Name and description |
---|---|
SQLConnection |
call(java.lang.String sql, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler) Calls the given SQL PROCEDURE which returns the result from the procedure. |
SQLConnection |
callWithParams(java.lang.String sql, java.util.List<java.lang.Object> params, java.util.List<java.lang.Object> outputs, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler) Calls the given SQL PROCEDURE which returns the result from the procedure. |
void |
close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler) Closes the connection. |
void |
close() Closes the connection. |
SQLConnection |
commit(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler) Commits all changes made since the previous commit/rollback. |
SQLConnection |
execute(java.lang.String sql, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler) Executes the given SQL statement |
java.lang.Object |
getDelegate() |
SQLConnection |
query(java.lang.String sql, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler) Executes the given SQL SELECT statement which returns the results of the query. |
SQLConnection |
queryWithParams(java.lang.String sql, java.util.List<java.lang.Object> params, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler) Executes the given SQL SELECT prepared statement which returns the results of the query. |
SQLConnection |
rollback(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler) Rolls back all changes made since the previous commit/rollback. |
SQLConnection |
setAutoCommit(boolean autoCommit, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler) Sets the auto commit flag for this connection. |
SQLConnection |
update(java.lang.String sql, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler) Executes the given SQL statement which may be an INSERT , UPDATE , or DELETE
statement. |
SQLConnection |
updateWithParams(java.lang.String sql, java.util.List<java.lang.Object> params, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler) Executes the given prepared statement which may be an INSERT , UPDATE , or DELETE
statement with the given parameters |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Calls the given SQL PROCEDURE
which returns the result from the procedure.
sql
- the SQL to execute. For example {call getEmpName (?, ?)}
.resultHandler
- the handler which is called once the operation completes. It will return a ResultSet
. Calls the given SQL PROCEDURE
which returns the result from the procedure.
sql
- the SQL to execute. For example {call getEmpName (?, ?)}
.params
- these are the parameters to fill the statement.outputs
- these are the outputs to fill the statement.resultHandler
- the handler which is called once the operation completes. It will return a ResultSet
.Closes the connection. Important to always close the connection when you are done so it's returned to the pool.
handler
- the handler called when this operation completes.Closes the connection. Important to always close the connection when you are done so it's returned to the pool.
Commits all changes made since the previous commit/rollback.
handler
- the handler called when this operation completes.Executes the given SQL statement
sql
- the SQL to execute. For example CREATE TABLE IF EXISTS table ...
resultHandler
- the handler which is called once this operation completes. Executes the given SQL SELECT
statement which returns the results of the query.
sql
- the SQL to execute. For example SELECT * FROM table ...
.resultHandler
- the handler which is called once the operation completes. It will return a ResultSet
. Executes the given SQL SELECT
prepared statement which returns the results of the query.
sql
- the SQL to execute. For example SELECT * FROM table ...
.params
- these are the parameters to fill the statement.resultHandler
- the handler which is called once the operation completes. It will return a ResultSet
.Rolls back all changes made since the previous commit/rollback.
handler
- the handler called when this operation completes.Sets the auto commit flag for this connection. True by default.
autoCommit
- the autoCommit flag, true by default.resultHandler
- the handler which is called once this operation completes. Executes the given SQL statement which may be an INSERT
, UPDATE
, or DELETE
statement.
sql
- the SQL to execute. For example INSERT INTO table ...
resultHandler
- the handler which is called once the operation completes. Executes the given prepared statement which may be an INSERT
, UPDATE
, or DELETE
statement with the given parameters
sql
- the SQL to execute. For example INSERT INTO table ...
params
- these are the parameters to fill the statement.resultHandler
- the handler which is called once the operation completes.