Connection.php

Go to the documentation of this file.
00001 <?php 00002 /* 00003 * $Id: Connection.php,v 1.2 2004/03/29 18:46:46 micha Exp $ 00004 * 00005 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00006 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00007 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00008 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00009 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00010 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00011 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00012 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00013 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00014 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00015 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00016 * 00017 * This software consists of voluntary contributions made by many individuals 00018 * and is licensed under the LGPL. For more information please see 00019 * <http://creole.phpdb.org>. 00020 */ 00021 00022 // 00023 // STATUS: 00024 // - ported: y 00025 // - compiled: y 00026 // - tested: n 00027 // 00028 00029 include_once 'creole/ResultSet.php'; // we need this for the fetchmode ResultSet flags (constants) that are passed to executeQuery() 00030 00042 class Connection 00043 { 00044 00045 // Constants that define transaction isolation levels. 00046 // [We don't have any code using these yet, so there's no need 00047 // to initialize these values at this point.] 00048 // const TRANSACTION_NONE = 0; 00049 // const TRANSACTION_READ_UNCOMMITTED = 1; 00050 // const TRANSACTION_READ_COMMITTED = 2; 00051 // const TRANSACTION_REPEATABLE_READ = 3; 00052 // const TRANSACTION_SERIALIZABLE = 4; 00053 00062 function connect($dsn, $flags = false) 00063 { 00064 trigger_error ( 00065 "Connection: abstract function connect() has to be reimplemented !", 00066 E_USER_ERROR 00067 ); 00068 } 00069 00074 function getResource() 00075 { 00076 trigger_error ( 00077 "Connection: abstract function getResource() has to be reimplemented !", 00078 E_USER_ERROR 00079 ); 00080 } 00081 00086 function getFlags() 00087 { 00088 trigger_error ( 00089 "Connection: abstract function getFlags() has to be reimplemented !", 00090 E_USER_ERROR 00091 ); 00092 } 00093 00099 function getDSN() 00100 { 00101 trigger_error ( 00102 "Connection: abstract function getDSN() has to be reimplemented !", 00103 E_USER_ERROR 00104 ); 00105 } 00106 00116 function getDatabaseInfo() 00117 { 00118 trigger_error ( 00119 "Connection: abstract function getDatabaseInfo() has to be reimplemented !", 00120 E_USER_ERROR 00121 ); 00122 } 00123 00128 function getIdGenerator() 00129 { 00130 trigger_error ( 00131 "Connection: abstract function getIdGenerator() has to be reimplemented !", 00132 E_USER_ERROR 00133 ); 00134 } 00135 00160 function prepareStatement($sql) 00161 { 00162 trigger_error ( 00163 "Connection: abstract function prepareStatement() has to be reimplemented !", 00164 E_USER_ERROR 00165 ); 00166 } 00167 00172 function createStatement() 00173 { 00174 trigger_error ( 00175 "Connection: abstract function createStatement() has to be reimplemented !", 00176 E_USER_ERROR 00177 ); 00178 } 00179 00190 function applyLimit(&$sql, $offset, $limit) 00191 { 00192 trigger_error ( 00193 "Connection: abstract function applyLimit() has to be reimplemented !", 00194 E_USER_ERROR 00195 ); 00196 } 00197 00206 function executeQuery($sql, $fetchmode = null) 00207 { 00208 trigger_error ( 00209 "Connection: abstract function executeQuery() has to be reimplemented !", 00210 E_USER_ERROR 00211 ); 00212 } 00213 00221 function executeUpdate($sql) 00222 { 00223 trigger_error ( 00224 "Connection: abstract function executeUpdate() has to be reimplemented !", 00225 E_USER_ERROR 00226 ); 00227 } 00228 00235 function prepareCall($sql) 00236 { 00237 trigger_error ( 00238 "Connection: abstract function prepareCall() has to be reimplemented !", 00239 E_USER_ERROR 00240 ); 00241 } 00242 00247 function close() 00248 { 00249 trigger_error ( 00250 "Connection: abstract function close() has to be reimplemented !", 00251 E_USER_ERROR 00252 ); 00253 } 00254 00260 function getAutoCommit() 00261 { 00262 trigger_error ( 00263 "Connection: abstract function getAutoCommit() has to be reimplemented !", 00264 E_USER_ERROR 00265 ); 00266 } 00267 00279 function setAutoCommit($bit) 00280 { 00281 trigger_error ( 00282 "Connection: abstract function setAutoCommit() has to be reimplemented !", 00283 E_USER_ERROR 00284 ); 00285 } 00286 00292 function commit() 00293 { 00294 trigger_error ( 00295 "Connection: abstract function commit() has to be reimplemented !", 00296 E_USER_ERROR 00297 ); 00298 } 00299 00305 function rollback() 00306 { 00307 trigger_error ( 00308 "Connection: abstract function rollback() has to be reimplemented !", 00309 E_USER_ERROR 00310 ); 00311 } 00312 00319 function getUpdateCount() 00320 { 00321 trigger_error ( 00322 "Connection: abstract function getUpdateCount() has to be reimplemented !", 00323 E_USER_ERROR 00324 ); 00325 } 00326 00327 }

This file is part of the Creole[php4] library.


Copyright © 2004 Hans Lellelid  
Creole[php4] CVS