sql 
[ doc home ] [ class tree: sql ] [ index: sql ] [ all elements ]

Class: IsterSqlConnection

Source Location: /IsterSqlConnection.php

Class Overview

IsterObject
   |
   --IsterSqlConnection

This class represents database connections.


Author(s): Ingo Schramm   

Copyright: Copyright (c) 2005 Ister.ORG Ingo Schramm

Methods


Child classes:

IsterSqlQuery
This class represents database queries.

Inherited Constants

Inherited Variables

Inherited Methods

Class: IsterObject

IsterObject::IsterObject()
Constructor
IsterObject::abstractMethodError()
Report attempt to call an abstract method.
IsterObject::addLogger()
Add an IsterLogger to process log messages.
IsterObject::deleteLogger()
Delete an already registered IsterLogger.
IsterObject::getLoggerNames()
Fetch the names of all currently registered IsterLoggers.
IsterObject::getMem()
Return maximum amount of memory an application has allocated at this point.
IsterObject::log()
Trigger a log message.
IsterObject::passPHPmessage()
Catch PHP E_WARNING and E_NOTICE messages.
IsterObject::serialize()
Serialize the object.
IsterObject::setLogLocal()
Set logging local for the current object.
IsterObject::setupLogger()
Setup a logger.
IsterObject::triggerError()
Alias for log();
IsterObject::unserialize()
Unserialize the object.
IsterObject::__sleep()
Executed prior to serialize().
IsterObject::__wakeup()
Executed prior to unserialize().

Class Details

This class represents database connections.

  1. require_once('IsterSqlConnection.php');
  2.  
  3. $con = new IsterSqlConnection('IsterSqlDriverPostgresql');
  4. $con->setConnection('localhost', 'testuser', 'testpass', 'testdb');
  5. $con->connect();
  6. if(! $con->isConnected() )
  7. die( $con->getLastError() );


copyright:  Copyright (c) 2005 Ister.ORG Ingo Schramm
author:  Ingo Schramm


[ Top ]


Class Methods


constructor IsterSqlConnection

IsterSqlConnection IsterSqlConnection( string $driver)

Constructor

Parameters:

string   $driver  

[ Top ]

method close

boolean close( )

Close the current connection.

[ Top ]

method connect

boolean connect( [boolean $newlink = false])

Establish a connection to the databse server.

Parameters:

boolean   $newlink   Force a new link to be created.

[ Top ]

method getConnection

array getConnection( )

Return the current connection parameters.

[ Top ]

method getDriver

object IsterSqlDriver &getDriver( )

Get the driver object of this connection.

return:  A reference to the driver object.
[ Top ]

method getLastError

string getLastError( )

Get the last error of the driver.

[ Top ]

method getLink

ressource getLink( )

Get the link ressource.

[ Top ]

method info

array info( )

Get an array with information about the driver and the connection.

[ Top ]

method isConnected

boolean isConnected( )

Check whether a connection is established.

[ Top ]

method pconnect

boolean pconnect( )

Establish a persistent connection to the databse server.

[ Top ]

method setConnection

boolean setConnection( string $server, string $username, string $password, string $db, [integer $port = null], [string $socket = null])

Setup the connection.

This method does not establish a connection to the database server.


Parameters:

string   $server  
string   $username  
string   $password  
string   $db  
integer   $port  
string   $socket  

[ Top ]


Documentation generated on Tue, 20 Dec 2005 11:21:10 +0100 by phpDocumentor 1.3.0RC4