pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
General question (C++ interfacing to PostgreSQL)
2+ messages / 2 participants
[nested] [flat]

* General question (C++ interfacing to PostgreSQL)
@ 2001-04-22 16:23  Carlos Moreno <moreno@mochima.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Carlos Moreno @ 2001-04-22 16:23 UTC (permalink / raw)
  To: pgsql-interfaces


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
--



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: General question (C++ interfacing to PostgreSQL)
@ 2001-04-23 14:16  J. T. Vermeulen <jtv@cistron-office.nl>
  parent: Carlos Moreno <moreno@mochima.com>
  0 siblings, 0 replies; 2+ messages in thread

From: J. T. Vermeulen @ 2001-04-23 14:16 UTC (permalink / raw)
  To: Carlos Moreno <moreno@mochima.com>; +Cc: pgsql-interfaces

On Sun, 22 Apr 2001, Carlos Moreno wrote:

> 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). 

Use whichever provides functionality you need--it's as simple as that.  If
you want to actually read values from the database (and I guess at some point
you will), use PgDatabase.

The current class hierarchy is a little confusing, and not always for very
good reasons.  So expect them to change radically in the not-too-far future.


Jeroen




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2001-04-23 14:16 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-04-22 16:23 General question (C++ interfacing to PostgreSQL) Carlos Moreno <moreno@mochima.com>
2001-04-23 14:16 ` J. T. Vermeulen <jtv@cistron-office.nl>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox