s = con.prepareStatement(stmt);
s.setString(1, coverageName);
res = s.executeQuery();
while (res.next()) {
ImageLevelInfo imageLevelInfo = new ImageLevelInfo();
imageLevelInfo.setCoverageName(coverageName);
imageLevelInfo.setTileTableName((res.getString(getConfig()
.getTileTableNameAtribute())));
imageLevelInfo.setExtentMaxX(new Double(res.getDouble(getConfig()
.getMaxXAttribute())));
if (res.wasNull()) {
imageLevelInfo.setExtentMaxX(null);
}
imageLevelInfo.setExtentMaxY(new Double(res.getDouble(getConfig()
.getMaxYAttribute())));
if (res.wasNull()) {
imageLevelInfo.setExtentMaxY(null);
}
imageLevelInfo.setExtentMinX(new Double(res.getDouble(getConfig()
.getMinXAttribute())));
if (res.wasNull()) {
imageLevelInfo.setExtentMinX(null);
}
imageLevelInfo.setExtentMinY(new Double(res.getDouble(getConfig()
.getMinYAttribute())));
if (res.wasNull()) {
imageLevelInfo.setExtentMinY(null);
}
imageLevelInfo.setResX(new Double(res.getDouble(getConfig().getResXAttribute())));
if (res.wasNull()) {
imageLevelInfo.setResX(null);
}
imageLevelInfo.setResY(new Double(res.getDouble(getConfig().getResYAttribute())));
if (res.wasNull()) {
imageLevelInfo.setResY(null);
}
/*
Set noDataValue on imageLevelInfo based on what
is stored in raster band metadata.
Please note: alternatively this value could be loaded from mosaic config file,
we could add an optional element/attribute to specify this value.
*/
Number noDataValue = getNoDataValue(imageLevelInfo.getTileTableName(), con);
imageLevelInfo.setNoDataValue(noDataValue);
getLevelInfos().add(imageLevelInfo);
imageLevelInfo.setCrs(getCRS());
/*
Set SrsId based on what has been specified in mosaic
xml configuration file. It can get overwritten by value retrieved from database in
method calculateResolutionsFromDB(). The reason I added this is: if user has specified
resolutions in the mosaic table, then calculateResolutionsFromDB() will skip setting srsID
which will eventually result in an exception further down the track.
*/
imageLevelInfo.setSrsId(getSrsId());
}
} catch (SQLException e) {
throw (e);
} finally {
if (res != null) {