public ProcessResult<TableInfo> query(DBManagerImpl dba) throws DatabaseException { try { ProcessResult<TableInfo> result = new ProcessResult<TableInfo>(); TableInfo ti = dba.getTableInfoByResultSet(); result.setData(ti); result.setSuccess(true); return result; } catch (Exception e) { logger.error(e.getMessage()); throw new DatabaseException(e.getMessage()); } }
public Map<String, Object> query4Map(DBManagerImpl dba) throws DatabaseException { ResultSet rs = null; try { rs = dba.executeOnlineQuery(); Map<String, Object> map = new HashMap<String, Object>(); if (rs != null) { while (rs.next()) { map.put(rs.getString(1), rs.getObject(2)); } } return map; } catch (Exception e) { logger.error(e.getMessage()); throw new DatabaseException(e.getMessage()); } }