From: | "Patrick Welche" <prlw1(at)newn(dot)cam(dot)ac(dot)uk> |
---|---|
To: | inkle99(at)yahoo(dot)com (inkle c) |
Cc: | prlw1(at)cam(dot)ac(dot)uk, pgsql-interfaces(at)postgresql(dot)org |
Subject: | Re: [INTERFACES] libpq++ ---- PgDatabase instance problem |
Date: | 1999-08-20 14:04:13 |
Message-ID: | E11HpHB-0000t1-00@quartz.newn.cam.ac.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | StOo | 1999-08-20 15:20:58 | eekk tuples ok when there not! |
Previous Message | inkle c | 1999-08-20 13:38:39 | Re: [INTERFACES] libpq++ ---- PgDatabase instance problem |