Skip to content

Commit

Permalink
Merge pull request #326 from aodn/2.5.4
Browse files Browse the repository at this point in the history
2.5.4
  • Loading branch information
ggalibert committed Mar 10, 2016
2 parents 5cc77db + 948d6dd commit 6baa8f3
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 18 deletions.
Binary file modified Java/ddb.jar
Binary file not shown.
15 changes: 10 additions & 5 deletions Java/src/org/imos/ddb/JDBCDDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.DatabaseMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
Expand Down Expand Up @@ -80,6 +81,10 @@ protected JDBCDDB(String driver, String connection, String user, String password

Connection conn = DriverManager.getConnection(connection, user, password);

// get the database's IdentifierQuote
DatabaseMetaData dbmd = conn.getMetaData();
identQuote = dbmd.getIdentifierQuoteString();

conn.close();
}

Expand Down Expand Up @@ -119,17 +124,17 @@ public ArrayList<Object> executeQuery(
results = new ArrayList<Object>();

//build the query
String query = "SELECT * FROM " + tableName;
String query = "SELECT * FROM " + identQuote + tableName + identQuote;
if (fieldName != null) {

if (fieldValue == null)
throw new Exception("a fieldValue must be provided");

//wrap strings in quotes
if (fieldValue instanceof String)
query += " WHERE " + fieldName + " = '" + fieldValue + "'";
query += " WHERE " + identQuote + fieldName + identQuote + " = '" + fieldValue + "'";
else
query += " WHERE " + fieldName + " = " + fieldValue;
query += " WHERE " + identQuote + fieldName + identQuote + " = " + fieldValue;
}

//execute the query
Expand All @@ -147,8 +152,8 @@ public ArrayList<Object> executeQuery(
//types of number or text. Don't tell anyone
if (fieldName != null && fieldValue instanceof String) {

query = "SELECT * FROM " + tableName +
" WHERE " + fieldName + " = " + fieldValue;
query = "SELECT * FROM " + identQuote + tableName + identQuote +
" WHERE " + identQuote + fieldName + identQuote + " = " + fieldValue;

System.out.println("JDBCDDB::Query : " + query);

Expand Down
4 changes: 2 additions & 2 deletions NetCDF/template/global_attributes_profile.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% what
S, project = Integrated Marine Observing System (IMOS)
S, Conventions = CF-1.6,IMOS-1.3
S, Conventions = CF-1.6,IMOS-1.4
S, standard_name_vocabulary = NetCDF Climate and Forecast (CF) Metadata Convention Standard Name Table 27
S, title =
S, institution =
Expand All @@ -19,7 +19,7 @@ S, site_code =
S, platform_code =
S, deployment_code =
S, featureType = profile
S, cdm_data_type = Profile
S, cdm_data_type = Station
S, naming_authority = IMOS
S, metadata =
S, sensorML =
Expand Down
4 changes: 2 additions & 2 deletions NetCDF/template/global_attributes_timeSeries.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% what
S, project = Integrated Marine Observing System (IMOS)
S, Conventions = CF-1.6,IMOS-1.3
S, Conventions = CF-1.6,IMOS-1.4
S, standard_name_vocabulary = NetCDF Climate and Forecast (CF) Metadata Convention Standard Name Table 27
S, title =
S, institution =
Expand All @@ -17,7 +17,7 @@ S, site_code =
S, platform_code =
S, deployment_code = [ddb Site]
S, featureType = [mat sample_data.meta.featureType]
S, cdm_data_type = Station
S, cdm_data_type =
S, naming_authority = IMOS
S, metadata =
S, sensorML =
Expand Down
2 changes: 1 addition & 1 deletion Parser/SBE37SMParse.m
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
end
else
% use the classic SBE3x ASCII format suggested for IMOS
sample_data = SBE3x(filename);
sample_data = SBE3x(filename, mode);
end

end
Expand Down
3 changes: 1 addition & 2 deletions Parser/readXR420.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
sample_data.meta.instrument_firmware = header.firmware;
sample_data.meta.instrument_serial_no = header.serial;
sample_data.meta.instrument_sample_interval = median(diff(data.time*24*3600));
sample_data.meta.correction = header.correction;
sample_data.meta.featureType = mode;

if isfield(header, 'correction'), sample_data.meta.correction = header.correction; end
Expand Down Expand Up @@ -465,4 +464,4 @@
% generate time stamps from start/interval/end
data.time = header.start:header.interval:header.end;
data.time = data.time(1:length(samples{1}))';
end
end
3 changes: 2 additions & 1 deletion Parser/signatureParse.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
cellSize = unique(vertcat(structures.(dataRecordType).Data.CellSize))*0.001; % m
blankDist = unique(vertcat(structures.(dataRecordType).Data.Blanking))*0.001; % m
if length(cellSize) > 1, error('Multiple cell sizes/blanking distance not supported'); end
distance = (blankDist): ...
distance = nan(nCells, 1);
distance(:) = (blankDist): ...
(cellSize): ...
(blankDist + (nCells-1) * cellSize);

Expand Down
4 changes: 2 additions & 2 deletions Parser/workhorseParse.m
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,11 @@

otherwise
adcpFreq = 2400;
model = 'unknown';
model = 'Unknown';

end

sample_data.meta.instrument_model = ['Workhorse ADCP model ' model];
sample_data.meta.instrument_model = [model ' Workhorse ADCP'];
sample_data.meta.instrument_serial_no = serial;
sample_data.meta.instrument_sample_interval = median(diff(time*24*3600));
sample_data.meta.instrument_firmware = ...
Expand Down
4 changes: 2 additions & 2 deletions Util/multipleLegend.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function [leg,labelhandles,outH,outM] = legend(varargin)
%LEGEND Display legend.
function [leg,labelhandles,outH,outM] = multipleLegend(varargin)
%MULTIPLELEGEND Display multiple legends.
% LEGEND(string1,string2,string3, ...) puts a legend on the current plot
% using the specified strings as labels. LEGEND works on line graphs,
% bar graphs, pie graphs, ribbon plots, etc. You can label any
Expand Down
2 changes: 1 addition & 1 deletion imosToolbox.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function imosToolbox(auto, varargin)
end

% Set current toolbox version
toolboxVersion = ['2.5.3 - ' computer];
toolboxVersion = ['2.5.4 - ' computer];

switch auto
case 'auto', autoIMOSToolbox(toolboxVersion, varargin{:});
Expand Down
Binary file modified imosToolbox_Linux64.bin
Binary file not shown.

0 comments on commit 6baa8f3

Please sign in to comment.