private function __construct($dsn = null) {
   global $cfg;

   if($dsn == null) {
       $dsn = $cfg['db']['dsn'];
   }

   println( "DSN: $dsn");

   $this->conn = DB::connect($dsn);
   if(DB::isError($this->conn)) {
      // Poczenie nieudane, zgasza wyjtek
      throw new Exception($this->conn->getMessage(), $this->conn->getCode());
   }
   // Dane zawsze zwracane jako tablica asocjacyjna
   $this->conn->setFetchMode(DB_FETCHMODE_ASSOC);
}
static public function instance() {
   static $objDB;

   if(! isset($objDB)) {
      $objDB = new Database();
   }

   return $objDB;
}