new JdbcConnection()
Represents the
JdbcConnection which is obtained from the JdbcService.
- Source:
Methods
-
close(handler)
-
Closes the connection. Important to always close the connection when you are done so it's returned to the pool.
Parameters:
Name Type Description handlerfunction - Source:
-
commit(handler) → {JdbcConnection}
-
Commits all changes made since the previous commit/rollback.
Parameters:
Name Type Description handlerfunction - Source:
Returns:
- Type
- JdbcConnection
-
execute(sql, resultHandler) → {JdbcConnection}
-
Executes the given SQL statement
Parameters:
Name Type Description sqlstring resultHandlerfunction - Source:
Returns:
- Type
- JdbcConnection
-
query(sql, params, resultHandler) → {JdbcConnection}
-
Executes the given SQL
SELECTstatement which returns the results of the query.Parameters:
Name Type Description sqlstring paramstodo resultHandlerfunction - Source:
Returns:
- Type
- JdbcConnection
-
rollback(handler) → {JdbcConnection}
-
Rolls back all changes made since the previous commit/rollback.
Parameters:
Name Type Description handlerfunction - Source:
Returns:
- Type
- JdbcConnection
-
setAutoCommit(autoCommit, resultHandler) → {JdbcConnection}
-
Sets the auto commit flag for this connection. True by default. Set to false if you want
Parameters:
Name Type Description autoCommitboolean resultHandlerfunction - Source:
Returns:
- Type
- JdbcConnection
-
update(sql, params, resultHandler) → {JdbcConnection}
-
Executes the given SQL statement which may be an
INSERT,UPDATE, orDELETEstatement.Parameters:
Name Type Description sqlstring paramstodo resultHandlerfunction - Source:
Returns:
- Type
- JdbcConnection