[Thread Prev][Thread Next][Index]

Re: [las_users] multiple MySQL drivers



Thanks Jon and Lynn for your insight on this.

I found a way around the problem. I had to create ONE MySQL driver where I just inserted all 4 drivers and added an IF statement at the beginning of each driver:

if($config->{db_name} eq 'databasename1'){
.
.
.
}

if($config->{db_name} eq 'databasename2'){
.
.
.
}

By the way, I found that the new insitu.pl (insitu.pl, v 1.15.4.8 2005/07/06 16:53:41 callahan) did not work. It did not pass "loca_table and data_table" information from the xml config to the driver.pm.
The old insitu.pl (v 1.7 2004/06/03 19:49:39 webuser) works great for me. I haven't had time to look more in details why the new insitu.pl doesn't work for me. It might be a change in variables names or something trivial.


Jerome King
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
Located at FED Santa Cruz CA:
(831) 420-3974




From: "Jerome King" <jejeking@hotmail.com>
To: Jonathan.S.Callahan@noaa.gov
CC: oar.pmel.las_users@noaa.gov
Subject: Re: [las_users] multiple MySQL drivers
Date: Wed, 16 Nov 2005 18:19:34 -0500

Hi Jon,

I have 4 different MySQL drivers because they have different JOINS in them so it was just easier to create a different driver for each database.

In insitu.pl, it seems that I can't specify 4 different MySQL driver but I can specify different types of database drivers but only one MySQL, one DAPPER, one Oracle,....
The db_type needs to be "mysql". I can't have db_type= mysql1 , db_type=mysql2, etc...

So I was wondering if there was a way for me to use my 4 MySQL drivers and refer them in some way in insitu.pl?
Or am I obligated to write ONE MySQL driver that regroups all 4 MySQL drivers?

Thanks for your help,
Jerome.




From: Jonathan Callahan <Jonathan.S.Callahan@noaa.gov>
To: Jerome King <jejeking@hotmail.com>
CC: oar.pmel.las_users@noaa.gov
Subject: Re: [las_users] multiple MySQL drivers
Date: Wed, 16 Nov 2005 13:10:43 -0800







Jerome,



I don't see why you shouldn't be able to have multiple drivers.  Just
for clarification, when we talk about a database 'driver', we're
referring to a perl module that inherits from TMAP::DBI and
deals with the specifics of some new database.



For each driver you must have a separte driver.pm file
and each driver must be mentioned in the insitu.pl file in
the same way as the other drivers.  Then each dataset configuration
file must mention it's own specific driver in the <database_access>
properties.



If, instead, what you've done is just put your data into separate MySQL
databases then you don't need different drivers at all.  Just refer to
the appropraite database and table in the <database_access>
properties.



I can't think of any reason why this shouldn't work.



Please clarify further if I've misunderstood what you're doing.





-- Jon





Jerome King wrote:
Hi all,




I have 4 LAS set up to talk to 4 different MySQL databases.




I am now working into grouping those 4 LAS into ONE LAS. Therefore this
ONE LAS will talk to 4 MySQL databases.


Since I wrote a different driver for each MySQL databases, I would like
to just refer those drivers in the insitu.pl instead of writing ONE
driver that would work for all 4 databases.




I refered them as "mysql1", "mysql2", "mysql3",...but of course this
did not work since the insitu.pl calls the module DBD/mysql.pm and
there are no DBD::mysql1 module, DBD::mysql2 module,....




I was wondering if there was a way to do this so I don't have to write
a driver that encompasses all 4 mini MySQL drivers.




Thanks,


Jerome












[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement