[Bio] / SeedViewer / MetagenomeAnalysis.pm Repository:
ViewVC logotype

Diff of /SeedViewer/MetagenomeAnalysis.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6, Tue Apr 29 23:01:55 2008 UTC revision 1.8, Wed May 7 20:31:19 2008 UTC
# Line 36  Line 36 
36    my $dbh;    my $dbh;
37    eval {    eval {
38    
39        my $dbms     = $FIG_Config::mgrast_dbms;
40      my $host     = $FIG_Config::mgrast_dbhost;      my $host     = $FIG_Config::mgrast_dbhost;
41      my $database = $FIG_Config::mgrast_db;      my $database = $FIG_Config::mgrast_db;
42      my $user     = $FIG_Config::mgrast_dbuser;      my $user     = $FIG_Config::mgrast_dbuser;
43      my $password = '';      my $password = '';
44    
45        if ($dbms eq 'Pg')
46        {
47            $dbh = DBI->connect("DBI:Pg:dbname=$database;host=$host", $user, $password,
48                            { RaiseError => 1, AutoCommit => 0, PrintError => 0 }) ||
49                                die "database connect error.";
50        }
51        elsif ($dbms eq 'mysql' or $dbms eq '') # Default to mysql
52        {
53      $dbh = DBI->connect("DBI:mysql:database=$database;host=$host", $user, $password,      $dbh = DBI->connect("DBI:mysql:database=$database;host=$host", $user, $password,
54                          { RaiseError => 1, AutoCommit => 0, PrintError => 0 }) ||                          { RaiseError => 1, AutoCommit => 0, PrintError => 0 }) ||
55                                            die "database connect error.";                                            die "database connect error.";
56        }
57        else
58        {
59            die "MetagenomeAnalysis: unknown dbms '$dbms'";
60        }
61    
62    };    };
63    if ($@) {    if ($@) {
64      warn "Unable to connect to metagenomics database: $@\n";      warn "Unable to connect to metagenomics database: $@\n";

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.8

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3