git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-dashboard-harvester-se-plugin@167603 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
5de25d5a2b
commit
97b1b48d46
|
@ -15,42 +15,19 @@ public class DatabaseManager {
|
|||
|
||||
private static Logger logger = LoggerFactory.getLogger(DatabaseManager.class);
|
||||
|
||||
public DatabaseManager() {
|
||||
|
||||
}
|
||||
|
||||
public void insertMonthlyData(Date from, Date to, List<HarvestedData> data, boolean updateFlag) {
|
||||
Dao dao = null;
|
||||
try {
|
||||
dao = dbConnect();
|
||||
dao.insertMonthlyMeasure(data, from, to, updateFlag);
|
||||
} catch(Exception e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
logger.error("", e);
|
||||
} finally {
|
||||
if(dao != null) {
|
||||
try {
|
||||
dao.disconnect();
|
||||
} catch(DaoException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String[] getActiveVres() {
|
||||
Dao dao = null;
|
||||
try {
|
||||
dao = dbConnect();
|
||||
return dao.getActiveVres();
|
||||
} catch(Exception e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
return null;
|
||||
} finally {
|
||||
if(dao != null) {
|
||||
try {
|
||||
dao.disconnect();
|
||||
} catch(DaoException e) {
|
||||
logger.error(e.getLocalizedMessage());
|
||||
logger.error("", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -64,5 +41,4 @@ public class DatabaseManager {
|
|||
dao.connect(dcd.getURI(), dcd.getUser(), dcd.getPassword());
|
||||
return dao;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue