//Step 1. Create a SeQuery and SeRow
SeRasterColumn rasterLayer = ........;
SeQuery query = new SeQuery(conn, cols, sqlConstruct);
query.prepareQuery();
query.execute();
SeRow
row = query.fetch();
//Step 2. Retrieve column definition and type from SeRow
SeColumnDefinition colDef = row.getColumnDef(rasterColumnNumber);
int type = colDef.getType();
//Step 3. Retrieve layer Id from raster column, create a new SeRaster,
get bands.
//if type is Raster
SeObjectId rasterLayerId = rasterLayer.getID();
SeRaster raster = new SeRaster(conn, rasterLayerId);
image.setRasterId(new SeObjectId(rasterId));
SeRasterBand[] rasBands = raster.getBands();
query.close();