public interface SQLClient extends SQLOperations
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the client
|
void |
close(Handler<AsyncResult<Void>> handler)
Close the client and release all resources.
|
SQLClient |
getConnection(Handler<AsyncResult<SQLConnection>> handler)
Returns a connection that can be used to perform SQL operations on.
|
default SQLClient |
query(String sql,
Handler<AsyncResult<ResultSet>> handler)
Execute a single SQL statement, this method acquires a connection from the the pool and executes the SQL
statement and returns it back after the execution.
|
default SQLClient |
queryWithParams(String sql,
JsonArray arguments,
Handler<AsyncResult<ResultSet>> handler)
Execute a single SQL prepared statement, this method acquires a connection from the the pool and executes the SQL
prepared statement and returns it back after the execution.
|
default SQLClient |
update(String sql,
Handler<AsyncResult<UpdateResult>> handler)
Executes the given SQL statement which may be an
INSERT, UPDATE, or DELETE
statement. |
default SQLClient |
updateWithParams(String sql,
JsonArray params,
Handler<AsyncResult<UpdateResult>> handler)
Executes the given prepared statement which may be an
INSERT, UPDATE, or DELETE
statement with the given parameters |
querySingle, querySingleWithParamsSQLClient getConnection(Handler<AsyncResult<SQLConnection>> handler)
handler - the handler which is called when the JdbcConnection object is ready for use.void close(Handler<AsyncResult<Void>> handler)
handler - the handler that will be called when close is completevoid close()
default SQLClient query(String sql, Handler<AsyncResult<ResultSet>> handler)
query in interface SQLOperationssql - the statement to executehandler - the result handlerStatement.executeQuery(String),
Statement.executeQuery(String)default SQLClient queryWithParams(String sql, JsonArray arguments, Handler<AsyncResult<ResultSet>> handler)
queryWithParams in interface SQLOperationssql - the statement to executearguments - the arguments to the statementhandler - the result handlerStatement.executeQuery(String),
Statement.executeQuery(String)default SQLClient update(String sql, Handler<AsyncResult<UpdateResult>> handler)
INSERT, UPDATE, or DELETE
statement.update in interface SQLOperationssql - the SQL to execute. For example INSERT INTO table ...handler - the handler which is called once the operation completes.Statement.executeUpdate(String),
Statement.executeUpdate(String)default SQLClient updateWithParams(String sql, JsonArray params, Handler<AsyncResult<UpdateResult>> handler)
INSERT, UPDATE, or DELETE
statement with the given parametersupdateWithParams in interface SQLOperationssql - the SQL to execute. For example INSERT INTO table ...params - these are the parameters to fill the statement.handler - the handler which is called once the operation completes.Statement.executeUpdate(String),
Statement.executeUpdate(String)Copyright © 2017. All rights reserved.