MIOLO20
Toggle main menu visibility
Página principal
Estruturas de dados
Estruturas de dados
Hierarquia de classes
Campos de dados
Tudo
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Funções
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Variáveis
$
a
b
c
d
e
f
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Ficheiros
Lista de ficheiros
Globais
Tudo
$
_
a
c
d
e
f
g
i
l
m
o
p
r
s
u
Funções
Variáveis
$
_
c
e
f
l
m
o
p
s
Exemplos
▼
MIOLO20
►
Estruturas de dados
▼
Ficheiros
▼
Lista de ficheiros
▼
classes
►
contrib
►
database
►
doc
▼
extensions
▼
doctrine-dbal
▼
Doctrine
►
Common
▼
DBAL
▼
Driver
▼
IBMDB2
►
DB2Connection.php
►
DB2Driver.php
►
DB2Exception.php
►
DB2Statement.php
►
OCI8
►
PDOIbm
►
PDOMySql
►
PDOOracle
►
PDOPgSql
►
PDOSqlite
►
PDOSqlsrv
►
Connection.php
►
PDOConnection.php
►
PDOStatement.php
►
Statement.php
►
Event
►
Logging
►
Platforms
►
Schema
►
Tools
►
Types
►
Configuration.php
►
Connection.php
►
ConnectionException.php
►
DBALException.php
►
Driver.php
►
DriverManager.php
►
Events.php
►
LockMode.php
►
Statement.php
►
Version.php
►
Symfony
►
jasper
►
spaw
►
class.phpmailer.php
►
class.smtp.php
►
cpaint.inc.php
►
cpaint_proxy.php
►
ezpdf
►
flow
►
interfaces
►
model
►
persistence
►
pslib
►
security
►
services
►
tests
►
ui
►
utils
►
compatibility.class
►
miolo.class
►
Globais
►
Exemplos
•
Tudo
Estruturas de dados
Namespaces
Ficheiros
Funções
Variáveis
Carregando...
Procurando...
Nenhuma entrada encontrada
DB2Connection.php
Ir para a documentação deste ficheiro.
1
<?php
2
/*
3
* $Id$
4
*
5
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16
*
17
* This software consists of voluntary contributions made by many individuals
18
* and is licensed under the LGPL. For more information, see
19
* <http://www.doctrine-project.org>.
20
*/
21
22
namespace
Doctrine\DBAL\Driver\IBMDB2
;
23
24
class
DB2Connection
implements
\Doctrine\DBAL\Driver\Connection
25
{
26
private
$_conn =
null
;
27
28
public
function
__construct
(array $params, $username, $password, $driverOptions = array())
29
{
30
$isPersistant = (isset($params[
'persistent'
]) && $params[
'persistent'
] ==
true
);
31
32
if
($isPersistant) {
33
$this->_conn = db2_pconnect($params[
'dbname'
], $username, $password, $driverOptions);
34
}
else
{
35
$this->_conn = db2_connect($params[
'dbname'
], $username, $password, $driverOptions);
36
}
37
if
(!$this->_conn) {
38
throw
new
DB2Exception
(db2_conn_errormsg());
39
}
40
}
28
public
function
__construct
(array $params, $username, $password, $driverOptions = array()) {
…
}
41
42
function
prepare
($sql)
43
{
44
$stmt = @db2_prepare($this->_conn, $sql);
45
if
(!$stmt) {
46
throw
new
DB2Exception
(db2_stmt_errormsg());
47
}
48
return
new
DB2Statement
($stmt);
49
}
42
function
prepare
($sql) {
…
}
50
51
function
query
()
52
{
53
$args = func_get_args();
54
$sql = $args[0];
55
$stmt = $this->
prepare
($sql);
56
$stmt->execute();
57
return
$stmt;
58
}
51
function
query
() {
…
}
59
60
function
quote
($input, $type=\PDO::PARAM_STR)
61
{
62
$input = db2_escape_string($input);
63
if
($type == \PDO::PARAM_INT ) {
64
return
$input;
65
}
else
{
66
return
"'"
.$input.
"'"
;
67
}
68
}
60
function
quote
($input, $type=\PDO::PARAM_STR) {
…
}
69
70
function
exec
($statement)
71
{
72
$stmt = $this->
prepare
($statement);
73
$stmt->execute();
74
return
$stmt->rowCount();
75
}
70
function
exec
($statement) {
…
}
76
77
function
lastInsertId
($name =
null
)
78
{
79
return
db2_last_insert_id($this->_conn);
80
}
77
function
lastInsertId
($name =
null
) {
…
}
81
82
function
beginTransaction
()
83
{
84
db2_autocommit($this->_conn, DB2_AUTOCOMMIT_OFF);
85
}
82
function
beginTransaction
() {
…
}
86
87
function
commit
()
88
{
89
if
(!db2_commit($this->_conn)) {
90
throw
new
DB2Exception
(db2_conn_errormsg($this->_conn));
91
}
92
db2_autocommit($this->_conn, DB2_AUTOCOMMIT_ON);
93
}
87
function
commit
() {
…
}
94
95
function
rollBack
()
96
{
97
if
(!db2_rollback($this->_conn)) {
98
throw
new
DB2Exception
(db2_conn_errormsg($this->_conn));
99
}
100
db2_autocommit($this->_conn, DB2_AUTOCOMMIT_ON);
101
}
95
function
rollBack
() {
…
}
102
103
function
errorCode
()
104
{
105
return
db2_conn_error($this->_conn);
106
}
103
function
errorCode
() {
…
}
107
108
function
errorInfo
()
109
{
110
return
array(
111
0 => db2_conn_errormsg($this->_conn),
112
1 => $this->
errorCode
(),
113
);
114
}
108
function
errorInfo
() {
…
}
115
}
24
class
DB2Connection
implements
\Doctrine\DBAL\Driver\Connection
{
…
};
Doctrine\DBAL\Driver\IBMDB2\DB2Connection
Definição
DB2Connection.php:25
Doctrine\DBAL\Driver\IBMDB2\DB2Connection\prepare
prepare($sql)
Definição
DB2Connection.php:42
Doctrine\DBAL\Driver\IBMDB2\DB2Connection\__construct
__construct(array $params, $username, $password, $driverOptions=array())
Definição
DB2Connection.php:28
Doctrine\DBAL\Driver\IBMDB2\DB2Connection\query
query()
Definição
DB2Connection.php:51
Doctrine\DBAL\Driver\IBMDB2\DB2Connection\errorCode
errorCode()
Definição
DB2Connection.php:103
Doctrine\DBAL\Driver\IBMDB2\DB2Connection\lastInsertId
lastInsertId($name=null)
Definição
DB2Connection.php:77
Doctrine\DBAL\Driver\IBMDB2\DB2Connection\exec
exec($statement)
Definição
DB2Connection.php:70
Doctrine\DBAL\Driver\IBMDB2\DB2Connection\errorInfo
errorInfo()
Definição
DB2Connection.php:108
Doctrine\DBAL\Driver\IBMDB2\DB2Connection\quote
quote($input, $type=\PDO::PARAM_STR)
Definição
DB2Connection.php:60
Doctrine\DBAL\Driver\IBMDB2\DB2Connection\rollBack
rollBack()
Definição
DB2Connection.php:95
Doctrine\DBAL\Driver\IBMDB2\DB2Connection\beginTransaction
beginTransaction()
Definição
DB2Connection.php:82
Doctrine\DBAL\Driver\IBMDB2\DB2Connection\commit
commit()
Definição
DB2Connection.php:87
Doctrine\DBAL\Driver\IBMDB2\DB2Exception
Definição
DB2Exception.php:25
Doctrine\DBAL\Driver\IBMDB2\DB2Statement
Definição
DB2Statement.php:25
Doctrine\DBAL\Driver\Connection
Definição
Connection.php:31
Doctrine\DBAL\Driver\IBMDB2
Definição
DB2Connection.php:22
classes
extensions
doctrine-dbal
Doctrine
DBAL
Driver
IBMDB2
DB2Connection.php
Gerado por
1.10.0