Re: [INTERFACES] libpq++ ---- PgDatabase instance problem
От | Patrick Welche |
---|---|
Тема | Re: [INTERFACES] libpq++ ---- PgDatabase instance problem |
Дата | |
Msg-id | E11HpHB-0000t1-00@quartz.newn.cam.ac.uk обсуждение исходный текст |
Ответ на | Re: [INTERFACES] libpq++ ---- PgDatabase instance problem (inkle c <inkle99@yahoo.com>) |
Список | 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 по дате отправления: