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
DB2Statement.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
DB2Statement
implements
\Doctrine\DBAL\Driver\Statement
25
{
26
private
$_stmt =
null
;
27
28
private
$_bindParam = array();
29
34
static
private
$_typeMap = array(
35
\PDO::PARAM_INT => DB2_LONG,
36
\PDO::PARAM_STR => DB2_CHAR,
37
);
38
39
public
function
__construct
($stmt)
40
{
41
$this->_stmt = $stmt;
42
}
39
public
function
__construct
($stmt) {
…
}
43
57
function
bindValue
($param, $value, $type =
null
)
58
{
59
return
$this->
bindParam
($param, $value, $type);
60
}
57
function
bindValue
($param, $value, $type =
null
) {
…
}
61
84
function
bindParam
($column, &$variable, $type =
null
)
85
{
86
$this->_bindParam[$column] =& $variable;
87
88
if
($type && isset(self::$_typeMap[$type])) {
89
$type = self::$_typeMap[$type];
90
}
else
{
91
$type = DB2_CHAR;
92
}
93
94
if
(!db2_bind_param($this->_stmt, $column,
"variable"
, DB2_PARAM_IN, $type)) {
95
throw
new
DB2Exception
(db2_stmt_errormsg());
96
}
97
return
true
;
98
}
84
function
bindParam
($column, &$variable, $type =
null
) {
…
}
99
105
function
closeCursor
()
106
{
107
if
(!$this->_stmt) {
108
return
false
;
109
}
110
111
$this->_bindParam = array();
112
db2_free_result($this->_stmt);
113
$ret = db2_free_stmt($this->_stmt);
114
$this->_stmt =
false
;
115
return
$ret;
116
}
105
function
closeCursor
() {
…
}
117
126
function
columnCount
()
127
{
128
if
(!$this->_stmt) {
129
return
false
;
130
}
131
return
db2_num_fields($this->_stmt);
132
}
126
function
columnCount
() {
…
}
133
141
function
errorCode
()
142
{
143
return
db2_stmt_error();
144
}
141
function
errorCode
() {
…
}
145
153
function
errorInfo
()
154
{
155
return
array(
156
0 => db2_stmt_errormsg(),
157
1 => db2_stmt_error(),
158
);
159
}
153
function
errorInfo
() {
…
}
160
175
function
execute
($params =
null
)
176
{
177
if
(!$this->_stmt) {
178
return
false
;
179
}
180
181
/*$retval = true;
182
if ($params !== null) {
183
$retval = @db2_execute($this->_stmt, $params);
184
} else {
185
$retval = @db2_execute($this->_stmt);
186
}*/
187
if
($params ===
null
) {
188
ksort($this->_bindParam);
189
$params = array_values($this->_bindParam);
190
}
191
$retval = @db2_execute($this->_stmt, $params);
192
193
if
($retval ===
false
) {
194
throw
new
DB2Exception
(db2_stmt_errormsg());
195
}
196
return
$retval;
197
}
175
function
execute
($params =
null
) {
…
}
198
226
function
fetch
($fetchStyle = \PDO::FETCH_BOTH)
227
{
228
switch
($fetchStyle) {
229
case \PDO::FETCH_BOTH:
230
return
db2_fetch_both($this->_stmt);
231
case \PDO::FETCH_ASSOC:
232
return
db2_fetch_assoc($this->_stmt);
233
case \PDO::FETCH_NUM:
234
return
db2_fetch_array($this->_stmt);
235
default
:
236
throw
new
DB2Exception
(
"Given Fetch-Style "
. $fetchStyle .
" is not supported."
);
237
}
238
}
226
function
fetch
($fetchStyle = \PDO::FETCH_BOTH) {
…
}
239
252
function
fetchAll
($fetchStyle = \PDO::FETCH_BOTH)
253
{
254
$rows = array();
255
while
($row = $this->
fetch
($fetchStyle)) {
256
$rows[] = $row;
257
}
258
return
$rows;
259
}
252
function
fetchAll
($fetchStyle = \PDO::FETCH_BOTH) {
…
}
260
272
function
fetchColumn
($columnIndex = 0)
273
{
274
$row = $this->
fetch
(\PDO::FETCH_NUM);
275
if
($row && isset($row[$columnIndex])) {
276
return
$row[$columnIndex];
277
}
278
return
false
;
279
}
272
function
fetchColumn
($columnIndex = 0) {
…
}
280
293
function
rowCount
()
294
{
295
return
(@db2_num_rows($this->_stmt))?:0;
296
}
293
function
rowCount
() {
…
}
297
}
24
class
DB2Statement
implements
\Doctrine\DBAL\Driver\Statement
{
…
};
Doctrine\DBAL\Driver\IBMDB2\DB2Exception
Definição
DB2Exception.php:25
Doctrine\DBAL\Driver\IBMDB2\DB2Statement
Definição
DB2Statement.php:25
Doctrine\DBAL\Driver\IBMDB2\DB2Statement\columnCount
columnCount()
Definição
DB2Statement.php:126
Doctrine\DBAL\Driver\IBMDB2\DB2Statement\closeCursor
closeCursor()
Definição
DB2Statement.php:105
Doctrine\DBAL\Driver\IBMDB2\DB2Statement\__construct
__construct($stmt)
Definição
DB2Statement.php:39
Doctrine\DBAL\Driver\IBMDB2\DB2Statement\rowCount
rowCount()
Definição
DB2Statement.php:293
Doctrine\DBAL\Driver\IBMDB2\DB2Statement\errorCode
errorCode()
Definição
DB2Statement.php:141
Doctrine\DBAL\Driver\IBMDB2\DB2Statement\bindParam
bindParam($column, &$variable, $type=null)
Definição
DB2Statement.php:84
Doctrine\DBAL\Driver\IBMDB2\DB2Statement\execute
execute($params=null)
Definição
DB2Statement.php:175
Doctrine\DBAL\Driver\IBMDB2\DB2Statement\fetchColumn
fetchColumn($columnIndex=0)
Definição
DB2Statement.php:272
Doctrine\DBAL\Driver\IBMDB2\DB2Statement\errorInfo
errorInfo()
Definição
DB2Statement.php:153
Doctrine\DBAL\Driver\IBMDB2\DB2Statement\bindValue
bindValue($param, $value, $type=null)
Definição
DB2Statement.php:57
Doctrine\DBAL\Driver\IBMDB2\DB2Statement\fetch
fetch($fetchStyle=\PDO::FETCH_BOTH)
Definição
DB2Statement.php:226
Doctrine\DBAL\Driver\IBMDB2\DB2Statement\fetchAll
fetchAll($fetchStyle=\PDO::FETCH_BOTH)
Definição
DB2Statement.php:252
Doctrine\DBAL\Driver\Statement
Definição
Statement.php:40
Doctrine\DBAL\Driver\IBMDB2
Definição
DB2Connection.php:22
classes
extensions
doctrine-dbal
Doctrine
DBAL
Driver
IBMDB2
DB2Statement.php
Gerado por
1.10.0