On Wednesday 23 July 2003 05:04 am, Adam Griffiths wrote:
<SNIP>
> <esql:connection>
> <esql:driver>Pg</esql:driver>
> <esql:dburl>dbname=axkit</esql:dburl>
> <esql:username>postgres</esql:username>
> <esql:password>password</esql:password>
> <esql:execute-query>
> <!-- esql stuff here -->
> </esql:execute-query>
> </esql:connection>
</SNIP>
One suggestion to make your ESQL code less redundant is to put your connection
information in environment variables. For instance, here's a (slightly
altered to protect the innocent) snippet from my httpd.conf:
PerlSetEnv PGDATABASE "dbname"
PerlSetEnv PGHOST "hostname"
PerlSetEnv PGUSER "username"
PerlSetEnv PGPASSWORD "[EMAIL PROTECTED]"
PerlSetEnv DBI_DSN "dbi:Pg:dbname=dbname;host=hostname"
Now all I have to do to make calls to my database is to do something like the
following:
<esql:connection>
<esql:execute-query>
....
</esql:execute-query>
</esql:connection>
--
/* Michael A. Nachbaur <[EMAIL PROTECTED]>
* http://nachbaur.com/pgpkey.asc
*/
"He expanded his chest to make it totally clear that here
was the sort of man you only dared to cross if you had a
team of Sherpas with you. "
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]