try {
try {
connection = getDataSource().getConnection( getSchema() );
} catch (Throwable t) {
throw new SpagoBIRuntimeException("An error occurred while creating connection", t);
}
try {
stmt = connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
} catch (Throwable t) {
throw new SpagoBIRuntimeException("An error occurred while creating connection steatment", t);
}
try {
//get max size
if(getMaxResults() > 0){
stmt.setMaxRows(getMaxResults());
}
resultSet = stmt.executeQuery( getStatement() );
} catch (Throwable t) {
logger.error("Trovata!:",t);
throw new SpagoBIRuntimeException("An error occurred while executing statement", t);
}
dataStore = null;
try {
dataStore = dataReader.read( resultSet );
} catch (Throwable t) {
throw new SpagoBIRuntimeException("An error occurred while parsing resultset", t);
}
if( isCalculateResultNumberOnLoadEnabled() ) {
}
} finally {
try {
releaseResources(connection, stmt, resultSet);
} catch(Throwable t) {
throw new SpagoBIRuntimeException("Impossible to release allocated resources properly", t);
}
}
return dataStore;
}