Source for file DBConn.php
Documentation is available at DBConn.php
* Teeple2 - PHP5 Web Application Framework inspired by Seasar2
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
* @author Mitsutaka Sato <miztaka@gmail.com>
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @param string $dsn DSN文字列
* @param string $user user名
* @param string $pass password
$this->log =
LoggerManager::getLogger(get_class($this));
$this->pdo =
new PDO($dsn, $user, $pass);
$this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$this->pdo->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, TRUE);
$this->pdo->exec('SET CHARACTER SET utf8');
$this->log->debug("DBConnを作成しました。({$this->id})
");
public function beginTransaction() {
$this->pdo->beginTransaction();
$this->log->debug("コネクション({
$this->id})のトランザクションを開始しました。
");
public function commit() {
$this->log->debug("コネクション({
$this->id})をコミットしました。
");
public function rollback() {
$this->log->debug("コネクション({
$this->id})をロールバックしました。
");
* @return Object PDOオブジェクト。
public function getDB() {
public function close() {