* @param $user String
* @param $password String
* @param $dbName String: database name
+ * @throws DBConnectionError
* @return DatabaseBase a fresh connection
*/
public function open( $server, $user, $password, $dbName ) {
/**
* The DBMS-dependent part of query()
* @param $sql String: SQL query.
+ * @throws DBUnexpectedError
* @return object Result object for fetch functions or false on failure
*/
protected function doQuery( $sql ) {
/**
* Start a transaction (mandatory)
*/
- public function begin( $fname = 'DatabaseIbm_db2::begin' ) {
+ protected function doBegin( $fname = 'DatabaseIbm_db2::begin' ) {
// BEGIN is implicit for DB2
// However, it requires that AutoCommit be off.
* End a transaction
* Must have a preceding begin()
*/
- public function commit( $fname = 'DatabaseIbm_db2::commit' ) {
+ protected function doCommit( $fname = 'DatabaseIbm_db2::commit' ) {
db2_commit( $this->mConn );
// Some MediaWiki code is still transaction-less (?).
/**
* Cancel a transaction
*/
- public function rollback( $fname = 'DatabaseIbm_db2::rollback' ) {
+ protected function doRollback( $fname = 'DatabaseIbm_db2::rollback' ) {
db2_rollback( $this->mConn );
// turn auto-commit back on
// not sure if this is appropriate
* LIST_SET - comma separated with field names, like a SET clause
* LIST_NAMES - comma separated field names
* LIST_SET_PREPARED - like LIST_SET, except with ? tokens as values
+ * @param array $a
+ * @param int $mode
+ * @throws DBUnexpectedError
* @return string
*/
function makeList( $a, $mode = LIST_COMMA ) {
*
* @param $sql string SQL query we will append the limit too
* @param $limit integer the SQL limit
- * @param $offset integer the SQL offset (default false)
+ * @param bool|int $offset SQL offset (default false)
+ * @throws DBUnexpectedError
* @return string
*/
public function limitResult( $sql, $limit, $offset=false ) {
* DELETE query wrapper
*
* Use $conds == "*" to delete all rows
+ * @param array $table
+ * @param array|string $conds
+ * @param string $fname
+ * @throws DBUnexpectedError
* @return bool|\ResultWrapper
*/
public function delete( $table, $conds, $fname = 'DatabaseIbm_db2::delete' ) {
/**
* Frees memory associated with a statement resource
* @param $res Object: statement resource to free
+ * @throws DBUnexpectedError
* @return Boolean success or failure
*/
public function freeResult( $res ) {