Sharing DB connections between programs

From: James Thompson <jamest(at)math(dot)ksu(dot)edu>
To: pgsql-general(at)postgreSQL(dot)org
Subject: Sharing DB connections between programs
Date: 1999-03-20 14:18:14
Message-ID: Pine.GSO.4.05.9903200754460.27689-100000@noether.math.ksu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


I have two programs A & B and a library C (postgres acces via ecpg)

A is tcl/tk gui tied to C

B generates postscript output (Quote/Sales order) for the records created
by A. It pulls its data directly from the database via calls to C.

I wanted B to be seperate from A because I see B generating HTML, SGML,
etc. in the future.

Right now B can be called from the command line and it generates its
output to stdout. Program A simply creates a shell and that executes

b username password servername recordnum | lpr

This seems very kludged. I don't like the fact that the password is part
of the command line. It seems that a simple ps at the right time would
give a person your database password. I would also prefer A to not keep a
copy of the password in a variable. I'm not a security expert but this
also seems like a bad idea to me.

My current thinking is that I should share the connection to the database
using method ????.

So what would be a good way to do this. Shared memory? Pipes? I never
user either of those in a program but I'm willing to learn. Something
else? Cobra? (I have NO idea how this stuff works, but willing to learn)

Any ideas or suggestions you may have are greatly appreciated. Thank you.

->->->->->->->->->->->->->->->->->->---<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<
James Thompson 138 Cardwell Hall Manhattan, Ks 66506 785-532-0561
Kansas State University Department of Mathematics
->->->->->->->->->->->->->->->->->->---<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<

Browse pgsql-general by date

  From Date Subject
Next Message Robert McArthur 1999-03-20 22:39:28
Previous Message Ronald L. Chichester 1999-03-20 04:17:25 Web Tools