<%doc>
# 
# $Id: db-connect-adv.ipfc,v 1.2 2002/01/27 21:47:24 fpmip Exp $
#
# db-connect.ipfc makes backend database connections
#
# Author : Tycho Fruru <tycho@fruru.com>

# Copyright (C) 2001, 2002 Tycho Fruru <tycho@fruru.com>
# Copyright (C) 2001, 2002 Conostix S.A. Luxembourg - Tycho Fruru <tycho@conostix.com>

# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.
#
</%doc>
<%args>
$db => 'secadvisory'
$username => 'alex'
$password => ''
</%args>

<%perl>
use DBI;

my $connect_string = "dbi:Pg:dbname=$db;host=127.0.0.1;port=5432";
#my $connect_string = "dbi:Pg:dbname=$db;host=192.168.0.200;port=5432";

my $dbh = DBI->connect($connect_string,$username,$password)
	or $m->abort("Database connection failed");
	
return $dbh;
</%perl>
