Example #1
0
 /**
  * Initialize the database connection.
  */
 public static function init()
 {
     if (GlobalProperties::$DATABASE_TYPE == "mysql") {
         $db = new MyConnection();
     }
     if (GlobalProperties::$DATABASE_TYPE == "pgsql") {
         $db = new PgConnection();
     }
     $db->setServer(GlobalProperties::$DATABASE_SERVER);
     $db->setPort(GlobalProperties::$DATABASE_PORT);
     $db->setUser(GlobalProperties::$DATABASE_USER);
     $db->setPassword(GlobalProperties::$DATABASE_PASSWORD);
     $db->setDatabase(GlobalProperties::$DATABASE_NAME);
     $db->connect();
     self::$connection = $db;
     self::$idBroker = new IdBroker();
 }
Example #2
0
 protected function DoOpen()
 {
     $this->queryResult = @pg_query($this->pgConnection->GetConnectionHandle(), $this->GetSQL());
     if ($this->queryResult) {
         return true;
     } else {
         return false;
     }
 }