import static com.narirelays.ems.exchange.sophic.SophicVars.*;
public class TestSophicHisDAO {
public static void main(String[] argv) throws ParseException{
SophicHistoryDAO sophicHistoryDAO = (SophicHistoryDAO)StorageService.ctx.getBean("sophicHistoryDAO");
String table_name = "ALARM_ALLEVENTLOG";
int table_unit = TABLE_UNIT_PERIOD_MONTH;
String id_col_name = "attr_oid";
String time_col_name = "acting_time";
List<String> keys = new ArrayList<String>();
keys.add("1");
Date startTime = sdf.parse("2011-06-21 04:30:00");
Date endTime = sdf.parse("2011-06-22 00:00:00");
int interval = 0;
// 如果输入的列名有错,查询肯定会报异常;处理
OperResult result = sophicHistoryDAO.queryHistory(table_name, table_unit,id_col_name,time_col_name,keys, startTime, endTime, interval);
if(result.isSUCCEED()){
System.out.println(JavaDataPrettyPrint.print_object(result.getData()));
}
}