ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/Genquire/BioSQL.cfg_example
Revision: 1.1
Committed: Wed Feb 27 13:40:58 2002 UTC (14 years, 5 months ago) by markw
Branch: MAIN
CVS Tags: Release4, HEAD_NEW, HEAD
Log Message:
major addition of a new adaptor layer for the bioperl-db database schema.  Updating of some documentation as well

Line File contents
1
2 # notice that you need to have bioperl-db installed
3 # this is NOT part of the core bioperl distribution
4 #use lib 'c:\bioperl\bioperl\db';
5 #use lib 'c:\bioperl\bioperl\core';
6
7
8 use Getopt::Long;
9 use Bio::DB::SQL::DBAdaptor;
10 use Bio::SeqIO;
11
12
13 my $host = "localhost";
14 my $sqlname = "BioSQL"; # this is the name of the database itself
15 my $dbuser = "root";
16 my $driver = 'mysql';
17 my $dbpass = "root";
18 my $dbname = "YourDataName"; # this is the name tag associated with the data in the datbase
19
20
21
22 # everything below should NOT be changed
23 # =======================================
24
25 $dbadaptor = Bio::DB::SQL::DBAdaptor->new(
26 -host => $host,
27 -dbname => $sqlname,
28 -driver => $driver,
29 -user => $dbuser,
30 -pass => $dbpass,
31 );
32
33 if ($dbadaptor) { #successful connection
34 use GQ::Server::BioSQL::Context;
35 $context=GQ::Server::BioSQL::Context->new($dbadaptor);
36 $context->dbname($dbname);
37 } else {
38 die "failed to connect to Database $sqlname";
39 }