Skip site navigation (1) Skip section navigation (2)

Re: [INTERFACES] libpq++ ---- PgDatabase instance problem

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: (view raw, whole thread or download thread mbox)
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...



In response to

pgsql-interfaces by date

Next:From: StOoDate: 1999-08-20 15:20:58
Subject: eekk tuples ok when there not!
Previous:From: inkle cDate: 1999-08-20 13:38:39
Subject: Re: [INTERFACES] libpq++ ---- PgDatabase instance problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group