Re: [INTERFACES] libpq++ ---- PgDatabase instance problem - Mailing list pgsql-interfaces

From Patrick Welche
Subject Re: [INTERFACES] libpq++ ---- PgDatabase instance problem
Date
Msg-id E11HpHB-0000t1-00@quartz.newn.cam.ac.uk
Whole thread Raw
In response to Re: [INTERFACES] libpq++ ---- PgDatabase instance problem  (inkle c <inkle99@yahoo.com>)
List pgsql-interfaces
inkle c wrote:
> 
> Well, this is where the problem comes because PgDatabase() is a
> protected constructor, myclass doesn't inherit from PgDatabase. In
> simple words:
> ==============================================
> class myclass {
>     public:
>            myclass();
>     private:
>            PgDatabase db;
> }
> 
> myclass::myclass():db(NULL){
> some-other-stuff-goes-here
> }; 
> ===============================================
> the above codes causes me trouble as I described 
> below, any ideas how to fix it? I also tried
> PgDatabase db as a global variable and init it to
> be NULL, but this causes the same problem.

As far as I remember if you send NULL, you are saying that
the string that PgDatabase uses is empty rather than being say
"dbname=test", and that it should try to connect ?using defaults?,
whereas if you just db(), you are saying, this instance isn't
initialised, create it, but don't connect. I'm afraid I can't
UTSL at the moment...

Cheers,

Patrick


pgsql-interfaces by date:

Previous
From: inkle c
Date:
Subject: Re: [INTERFACES] libpq++ ---- PgDatabase instance problem
Next
From: StOo
Date:
Subject: eekk tuples ok when there not!