From: <no...@cp...> - 2005-10-28 19:43:32
|
Hi Chris, With the new download from repository, the connection is getting well now. But in the documentation and comments in the file DBStag.pm, it is mentionned that the dbi string must include dbname=. Thats why i was confused in my command line. Unfortunately i still have the problem of the DB2 driver for DBStag, using the Pg one in place doesn't work. I am currently try to implement gmod-chado on DB2 and i was working on loading ontolgies. I wanted to use the go-perl method to do it since the next releease of gmod will use it and it loads ontologies better that the method with gmod_load_ontology.pl in the last release. If i don't find that DB2 driver, i will be obliged to use the old method to load my ontologies. I will try to find someone who can help me on DBI-DB2 sourceforge mailing list. Thank you very much for your help. etienne > > > On Fri, 28 Oct 2005 no...@cp... wrote: > >> Hi Chris, >> This is what i got from my debugging: >> The is a problem with your regular expression for the connection >> variables. >> >> I edited the file stag-storenode.pl and printed the variable $db, $user >> and $pass that are passed to CONNECT($db,$user,$pass) >> 1- It includes "dbname=" in the database name >> ($db=dbi:DB2:dbname=db2chado). >> 2- The password is empty $pass=""; > > I'm a little confused. What are your command line arguments? Are you > passing in a full DBI string as the "-d" option, or just the shorthand > name? > >> I modified it by including this in the code: >> ### modification by etienne to test the connection ## >> $db =~ s/dbname\=//; >> $pass="xxxxxxx"; >> print "Database=$db\t User=$user\t Password=$pass\n"; >> The connection went well after that. > > It seems that you're passing in a full DBI locator like this: > > -d "dbi:DB2:dbname=db2chado" > > then you're just getting rid of the "dbname" tag? Why not just omit it in > the first place (on the command line)? > > It would still be nice to have the DBI string constructed automatically - > based on your previous email, I believe the following piece of code should > work with DB2 (unfortunately this is one of these things that varies from > driver to driver): > > if ($dbms =~ /pg/i) { > $dbi = "dbi:Pg:dbname=$dbn;host=$host"; > } > elsif ($dbms =~ /db2/i) { > $dbi = "dbi:Pg:$dbn;host=$host"; > } > else { > # default - tested on MySQL > $dbi = "dbi:$dbms:database=$dbn:host=$host"; > } > > This is committed - can you test this? > >> Now the big problem is that the DB2 driver for DBIx-DBSchema seems not >> to >> exist. >> This is the new error i am getting now: >> # stag-storenode.pl -d dbi:DB2:dbname=db2chado -user db2inst1 -pass >> xxxx >> so.chado >> Database=dbi:DB2:db2chado User=db2inst1 Password=xxxx >> Can't locate DBIx/DBSchema/DBD/DB2.pm in @INC (@INC contains: >> /usr/lib/perl5/........) > > OK, this may be a bigger problem. DBStag uses DBIx::DBSchema to introspect > the schema. I don't maintain DBSchema. > > The options here are: > > find someone who knows more about the guts of DB2 and get them to > contribute a DB2 adapter for DBSchema. I'm not sure how likely this is. > > Use SQL::Translator to introspect the schema. This may not help if no one > has written the DBI introspection code for DB2 - can one of the sqlfairys > comment on this? > > Read the schema information in statically from a chado schema file (using > SQL::T to parse) > > THe final option is my least favourite - it would make running the DBStag > scripts more of a hassle (of course, this would only be a requirement for > DB2 users and other non-supported DBMSs). However, it's probably the one > most likely to succeed for a variety of non mysql and pg dbmss. > > How soon do you need this? How likely do you think it would be to find > someone to do option #1? > >> I tried to find that driver on the net i didn't find anything. This is >> what i got from rpm redhat web site. >> Download >> ftp.gmd.de perl-DBIx-DBSchema-0.15-10.i386.rpm >> ftp.uni-bayreuth.de perl-DBIx-DBSchema-0.15-10.i386.rpm >> carroll.aset.psu.edu perl-DBIx-DBSchema-0.15-10.i386.rpm >> ftp.rediris.es perl-DBIx-DBSchema-0.15-10.i386.rpm >> ftp.kddlabs.co.jp perl-DBIx-DBSchema-0.15-10.i386.rpm >> ftp.freshrpms.net perl-DBIx-DBSchema-0.15-10.i386.rpm >> ftp.nluug.nl perl-DBIx-DBSchema-0.15-10.i386.rpm >> ftp.pbone.net perl-DBIx-DBSchema-0.15-10.i386.rpm >> ftp.task.gda.pl perl-DBIx-DBSchema-0.15-10.i386.rpm >> ftp.sunet.se perl-DBIx-DBSchema-0.15-10.i386.rpm >> Search for other platforms >> perl-DBIx-DBSchema-0.15-10.sparc.rpm >> perl-DBIx-DBSchema-0.15-10.alpha.rpm >> perl-DBIx-DBSchema-0.15-10.ppc.rpm >> perl-DBIx-DBSchema-0.15-10.ia64.rpm >> perl-DBIx-DBSchema-0.15-10.s390.rpm >> >> Provides : >> perl(DBIx::DBSchema) >> perl(DBIx::DBSchema::ColGroup) >> perl(DBIx::DBSchema::ColGroup::Index) >> perl(DBIx::DBSchema::ColGroup::Unique) >> perl(DBIx::DBSchema::Column) >> perl(DBIx::DBSchema::DBD) >> perl(DBIx::DBSchema::DBD::Pg) >> perl(DBIx::DBSchema::DBD::mysql) >> perl(DBIx::DBSchema::Table) >> perl-DBIx-DBSchema >> >> There is no mention of perl(DBIx::DBSchema::DBD::DB2) >> I have to find that driver now. If you know where i can get it, i will >> be >> grateful. >> Thank you >> etienne noumen >> > >> > That's odd, here's the relevant piece of code from DBStag.pm: >> > >> > sub connect { >> > my $class = shift; >> > my $dbi = shift; >> > my $self; >> > if (ref($class)) { >> > $self = $class; >> > } >> > else { >> > $self = {}; >> > bless $self, $class; >> > } >> > $dbi = $self->resolve_dbi($dbi); >> > eval { >> > $self->dbh(DBI->connect($dbi, @_)); >> > }; >> > >> > You can see that @_ will be the extra params passed in to the connect >> > method. If you're using the stag-storenode.pl from cvs, then this >> should >> > include $user and $pass >> > >> > what happens when you step through with the debugger? >> > >> > Thanks for helping test this with DB2. >> > >> > On Thu, 27 Oct 2005 no...@cp... wrote: >> > >> >> Hi Chris, >> >> I read the file DBStag.pm and I didn't find where the user and pass >> >> option >> >> are added. I think that there is a problem with resolving the >> variable >> >> $dbi for DB2. >> >> According to my script, it must be resolved like this: >> >> my $dbh = DBI->connect("dbi:DB2:$database","db2inst1","xxxxxxx") >> >> where $dbi="dbi:DB2:$database","db2inst1","xxxxxxx" >> >> In DBStag, your script is trying to do >> >> DBI->connect('dbname=db2chado','db2inst1',...) >> >> $dbi="dbi:$dbms:database=$dbn and it fails. >> >> Can you clarify this? >> >> Thanks >> >> >> >> > Yes, I made a fix for the regexp as well as adding the user and >> pass >> >> > options in cvs - are you using the cvs version now? See stag.sf.net >> >> for >> >> > details >> >> > >> >> > On Oct 27, 2005, at 11:41 AM, no...@cp... wrote: >> >> > >> >> >> Hi Chris, >> >> >> I suspect that the DBStag.pm script is not dealing well with the >> >> >> regular >> >> >> expression top extract the database name and password. >> >> >> I wrote a perl script to test my DB2 connection and DBI-DB2 and it >> >> >> works >> >> >> perfect. This is how i am connecting to my database in my script: >> >> >> ***** my perl script to connect to DB2****** >> >> >> my $database = "DB2CHADO"; >> >> >> my $dbh = >> DBI->connect("dbi:DB2:$database","db2inst1","xxxxxxxx") >> >> >> || die "Cannot log into $database\n"; >> >> >> >> >> >> >> >> >> *********************************************** >> >> >> db2inst1 is the user and xxxxxxxx the password. >> >> >> >> >> >> I tried this command to load ontology with DBStag and this is what >> i >> >> >> get: >> >> >> #export LD_LIBRARY_PATH='/home/db2inst1/sqllib/lib' >> >> >> #stag-storenode.pl -d dbi:DB2:database=DB2CHADO -u db2inst1 -p >> >> >> instamatic >> >> >> so.chado DBI connect('database=DB2CHADO','',...) failed: [IBM][CLI >> >> >> Driver] >> >> >> CLI0124E Invalid argument value. SQLSTATE=HY009 at >> >> >> /usr/lib/perl5/site_perl/5.8.3/DBIx/DBStag.pm line 81 >> >> >> >> >> >> Could not connect to database: "dbi:DB2:database=DB2CHADO" >> >> >> >> >> >> EITHER The required DBD driver "DB2" is not installed >> >> >> OR There is no such database as "dbi:DB2:database=DB2CHADO" >> >> >> >> >> >> Died at /usr/lib/perl5/site_perl/5.8.3/DBIx/DBStag.pm line 120. >> >> >> >> >> >> I also tried this: >> >> >> stag-storenode.pl -d >> >> >> dbi:DB2:database=DB2CHADO;user=db2inst1;password=instamatic >> so.chado >> >> >> >> >> >> and none of them is working. >> >> >> >> >> >> What do you think about that? >> >> >> thank you >> >> >> etienne >> >> >> >> >> >>> >> >> >>> OK, now fixed in cvs - you can use -user and -pass options >> >> >>> >> >> >>> once we've got the whole thing working with your setup I''l do >> >> another >> >> >>> CPAN release >> >> >>> >> >> >>> On Wed, 26 Oct 2005 no...@cp... wrote: >> >> >>> >> >> >>>> Thanks Chris, >> >> >>>> but it is still not working. >> >> >>>> This is the error i got: >> >> >>>> [db2inst1@jamga gmod-0.003]$ stag-storenode.pl -d >> >> >>>> dbi:DB2:dbname=db2_gmod:host=jamga.cpsc.ucalgary.c a so.chado >> >> >>>> DBI >> connect('dbname=db2_gmod:host=jamga.cpsc.ucalgary.ca','',...) >> >> >>>> failed: >> >> >>>> [IBM][CLI Driver] CLI0124E Invalid argument value. >> SQLSTATE=HY009 >> >> >>>> at >> >> >>>> /usr/lib/perl5/site_perl/5.8.3/DBIx/DBStag.pm line 81 >> >> >>>> >> >> >>>> Could not connect to database: >> >> >>>> "dbi:DB2:dbname=db2_gmod:host=jamga.cpsc.ucalgary.ca" >> >> >>>> >> >> >>>> EITHER The required DBD driver "DB2" is not installed >> >> >>>> OR There is no such database as >> >> >>>> "dbi:DB2:dbname=db2_gmod:host=jamga.cpsc.ucalgary.ca" >> >> >>>> >> >> >>>> Died at /usr/lib/perl5/site_perl/5.8.3/DBIx/DBStag.pm line 120. >> >> >>>> >> >> >>>> My Class::DBI::DB2 is correctly installed. My DBD::DB2 is >> >> correctly >> >> >>>> installed. >> >> >>>> In your connect procedure, there is no way to specify the >> password? >> >> >>>> Can i specify it on the command line? how? >> >> >>>> thanks >> >> >>>> etienne >> >> >>>> >> >> >>>>> >> >> >>>>> Looks like my regular expression wasn't built to deal with >> drivers >> >> >>>> that >> >> >>>>> had non-numbers in the name, oops! >> >> >>>>> >> >> >>>>> I can fix this in cvs, but in the meantime you may want to just >> >> >>>> specify >> >> >>>>> the full DBI locator on the command line and bypass the conf >> file/ >> >> >>>>> I'm >> >> >>>>> sure there will be a few other DB2 related gotchas we'lll need >> to >> >> >>>>> sort >> >> >>>> out >> >> >>>>> along the way... >> >> >>>>> >> >> >>>>> >> >> >>>>> On Wed, 26 Oct 2005 no...@cp... wrote: >> >> >>>>> >> >> >>>>>> Hi Chris, >> >> >>>>>> I have been able to load the ontolongy so.obo in our >> PostgreSQL >> >> >>>>>> chado >> >> >>>>>> database using the 2 scripts go2chadoxml and >> stag-storenode.pl. >> >> >>>>>> But with DB2 , i have problems. It looks like the DBIx-DBStag >> is >> >> >>>> always >> >> >>>>>> looking for Pg database. >> >> >>>>>> This is my DB locator conf file: >> >> >>>>>> >> >> >>>>>> # LOCAL >> >> >>>>>> mytestdb rdb Pg:test >> >> >>>> schema=test >> >> >>>>>> >> >> >>>>>> # SYSTEM >> >> >>>>>> dev_chado_00 rdb >> Pg:dev...@ja... >> >> >>>>>> schema=chado >> >> >>>>>> db2_gmod rdb DB2:db2...@ja... >> >> >>>>>> schema=db2_chado >> >> >>>>>> >> >> >>>>>> >> >> >>>>>> This is my command for loading ontology in DB2 database: >> >> >>>>>> stag-storenode.pl -d db2inst1 so.chado >> >> >>>>>> DBI connect('dbname=db2inst1','',...) failed: FATAL: database >> >> >>>>>> "db2inst1" >> >> >>>>>> does not exist >> >> >>>>>> at /usr/lib/perl5/site_perl/5.8.3/DBIx/DBStag.pm line 81 >> >> >>>>>> >> >> >>>>>> Could not connect to database: "dbi:Pg:dbname=db2inst1" >> >> >>>>>> >> >> >>>>>> EITHER The required DBD driver "Pg" is not installed >> >> >>>>>> OR There is no such database as "dbi:Pg:dbname=db2inst1" >> >> >>>>>> >> >> >>>>>> Died at /usr/lib/perl5/site_perl/5.8.3/DBIx/DBStag.pm line >> 120. >> >> >>>>>> >> >> >>>>>> I don't know why he is looking for dbi:Pg:dbname=db2inst1 and >> not >> >> >>>>>> dbi:DB2:dbname=dbinst1 ? >> >> >>>>>> >> >> >>>>>> Thank you >> >> >>>>>> etienne >> >> >>>>>> >> >> >>>>>>> >> >> >>>>>>> It's a 2-step process >> >> >>>>>>> >> >> >>>>>>> go2chadoxml myontology.obo > myontology.chado >> >> >>>>>>> stag-storenode.pl -d DBNAME myontology.chado >> >> >>>>>>> >> >> >>>>>>> DBNAME can be a full DBI locator, or shorthand of the form >> >> >>>>>> DBMS:NAME@HOST, >> >> >>>>>>> or it can be a logical name. See the DBIx::DBStag manpage for >> >> >>>> setting >> >> >>>>>> up a >> >> >>>>>>> conf file for mapping logical names to locators >> >> >>>>>>> >> >> >>>>>>> Sorry this isn't documented in a central place yet >> >> >>>>>>> >> >> >>>>>>> On Tue, 18 Oct 2005 no...@cp... wrote: >> >> >>>>>>> >> >> >>>>>>>> Hi Chris, >> >> >>>>>>>> I want to test the load_ontology using go-perl and >> DBIx::DBStag >> >> >>>>>>>> on >> >> >>>>>>>> postgreSQL. >> >> >>>>>>>> I have installed them successfully, but I don't really know >> >> what >> >> >>>> is >> >> >>>>>> the >> >> >>>>>>>> process to use them to load ontologies on our chado >> PostgreSQL >> >> >>>>>> database. >> >> >>>>>>>> Our objective is to use them on DB2, but i would like to be >> >> able >> >> >>>> to >> >> >>>>>> test >> >> >>>>>>>> it on PostgreSQL before. >> >> >>>>>>>> Thank you >> >> >>>>>>>> etienne >> >> >>>>>>>> >> >> >>>>>>>> >> >> >>>>>>> >> >> >>>>>>> >> >> >>>>>>> >> >> >>>>>>> >> >> >>>>>>> ------------------------------------------------------- >> >> >>>>>>> This SF.Net email is sponsored by: >> >> >>>>>>> Power Architecture Resource Center: Free content, downloads, >> >> >>>>>> discussions, >> >> >>>>>>> and more. http://solutions.newsforge.com/ibmarch.tmpl >> >> >>>>>>> _______________________________________________ >> >> >>>>>>> Gmod-schema mailing list >> >> >>>>>>> Gmo...@li... >> >> >>>>>>> https://lists.sourceforge.net/lists/listinfo/gmod-schema >> >> >>>>>>> >> >> >>>>>> >> >> >>>>>> >> >> >>>>>> >> >> >>>>> >> >> >>>>> >> >> >>>> >> >> >>>> >> >> >>>> >> >> >>> >> >> >>> >> >> >> >> >> >> >> >> > >> >> >> >> >> >> >> > >> > >> >> >> > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by the JBoss Inc. > Get Certified Today * Register for a JBoss Training Course > Free Certification Exam for All Training Attendees Through End of 2005 > Visit http://www.jboss.com/services/certification for more information > _______________________________________________ > Gmod-schema mailing list > Gmo...@li... > https://lists.sourceforge.net/lists/listinfo/gmod-schema > |