Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f3MKD7374151 for ; Sun, 22 Apr 2001 16:13:07 -0400 (EDT) (envelope-from pgsql-interfaces-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3MGPk305702 for ; Sun, 22 Apr 2001 12:25:46 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f3MGNXK27691 for pgsql-interfaces@postgresql.org; Sun, 22 Apr 2001 12:23:33 -0400 (EDT) (envelope-from news) From: Carlos Moreno X-Newsgroups: comp.databases.postgresql.interfaces Subject: General question (C++ interfacing to PostgreSQL) Date: Sun, 22 Apr 2001 12:23:06 -0400 Organization: Mochima Software / AudioSystems Lines: 32 Message-ID: <3AE3056A.AF530097@mochima.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: scrappy@hub.org X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) X-Accept-Language: en To: pgsql-interfaces@postgresql.org X-Archive-Number: 200104/98 X-Sequence-Number: 1482 I'm just curious about what the standard practice for creating PgConnection/PgDatabase objects should be. First, I'm not quite sure when or how should I use PgDatabase (in the simple tests that I've done so far, I use only PgConnection). As for the PgConnection, I'm wondering if I should create them as local variables whenever I need to execute a selcect or insert/update/delete statement, or if it is a better idea to keep a unique (possibly global) PgConnection object and keep asking it to Exec SQL statements. Is there any considerable overhead when creating PgConnection instances? Are multiple instances asking for trouble? There's probably a tutorial where these guidelines are? I haven't been able to find it, but if someone points me to such tutorial, I'd be very grateful! Oh, another thing... How can I prevent output from being sent to stdout whenever I execute a SELECT statement? I'd like to get the data, and not send it to stdout -- however, when I do connect.Exec ("select ..... "), I get the results of the SQL statement displayed without the program cout'ing them explicitly... Thanks! Carlos --