The dataset configuration file for a dataset that requires database access must include information that describes the location and nature of the data to the database service. The database service will use this information to access the data and properly convert the data into an intermediate NetCDF file.
The dataset will typically require a new user interface behavior -- the combination of Views/Products/Options presented by the LAS user interface (UI). Both the UI and database access information are specified as a set of properties within the dataset <properties> ... </properties> tags.
The <properties> section of the insitu_demo_1.xml file distributed with LAS is given below:
<properties>
<ui>
<default>file:ui.xml#insitu_demo</default>
</ui>
<database_access name="mysql">
<db_type>mysql</db_type>
<db_name>LAS_insitu_demo</db_name>
<db_title>LAS in-situ demo</db_title>
<db_host>localhost</db_host>
<db_table>Indian</db_table>
<longitude>Longitude</longitude>
<lon_domain>0:360</lon_domain>
<latitude>Latitude</latitude>
<depth>Depth</depth>
<depth_units>meters</depth_units>
<time>t</time>
<time_sample>19990101</time_sample>
<time_type>int</time_type>
<time_format>YYYYMMdd</time_format>
<time_units>hours since 1970-01-01 00:00:00</time_units>
<hours_1970></hours_1970>
<profID></profID>
<cruiseID>CruiseNum</cruiseID>
<metadata></metadata>
<executable></executable>
<missing>-999</missing>
<timeout>180</timeout>
</database_access>
</properties>
The <ui> properties are described in the section on Configuring the UI for scattered data.
The <database_access> properties are described below:
- db_type
- one of mysql | ???
- db_name
- the name of the database to be used when configuring the database (see Configuring the LAS database service)
- db_title
- title to be used with this dataset (the title will appear on ???)
- db_host
- domain name of the machine hosting the database server
- db_table
- name of the table in which the data is stored
- longitude
- name of the database variable containing longitude values
- lon_domain
- range of longitude values stored in the database (typically 0:360 or -180:180)
- latitude
- name of the database variable containing latitude values
- depth
- (optional) name of the database variable containing depth values
- depth_units
- (optional) units associated with the depth variable (e.g. meters)
- time
- name of the database variable containing time values
- time_units
- units associated with the time variable (e.g. hours since 1970-01-01 00:00:00)
- time_type
- data type of the time variable stored in the database (use double for all numeric times)
Currently, time_type must be one of double | int | string. The behavior of the database service is to assume that time variables with a type of double have appropriate units and can be written directly into the intermediate NetCDF file. Whenever the database service encounters a time of type int or string it assumes that the time variable has an ASCII representation that must be converted into a floating point value. The conversion is performed by the the org.joda.time library. (If the time variable in your database is stored as type floatyou must still specify double in the <database_access>properties. This will be corrected in a future release of LAS.)
- time_format
- coaches org.joda.time library on how to interpret ASCII representation sof time (joda time format patterns)
- profID
- (optional) name of the database variable containing the profile ID
A profile ID variable can be used to associate multiple records in a database with a single atmospheric or oceanographic profile. If specified, the variable identified by profID will be written to the intermediate NetCDF file as PROF_ID. As released, LAS supports several Ferret based products that rely on the presence of the PROF_ID variable in the intermediate NetCDF file.
- cruiseID
- (optional) name of the database variable containing the cruise ID
The comments for profID apply for cruiseID as well.
- missing
- missing_value flag to be used in the intermediate NetCDF file
There is currently no way to identify missing value flags that are stored in the database.
- timeout (not yet implemented)
- database timeout
- N.B. In previous versions of LAS, you were required to put the database login and password information in your data set configuration. As of LAS 7.x this is no longer required or recommended. This information is now stored in the database backend configuration file. These properties are ignored by LAS.
- db_login
- login name with SELECT permission on the required data tables
- db_passwd
- password associated with db_login