2015년 1월 27일 화요일

[PI] JDBC Lookup Service

Channel channel = null;
DataBaseAccessor accessor = null;

DataBaseResult resultSet = null;

String query = "select A, B, C from dual";


MappingTrace trace = container.getTrace();


try{

 channel = LookupService.getChannel("[Business System]", "JDBC Channel");

 accessor = LookupService.getDataBaseAccessor(channel);

 resultSet = accessor.excute(query);


 trace.addInfo(query);


 for (Iterator rows = resultSet.getRow() ; rows.hasNext();){

  Map rowMap = (Map) rows.next();

  A.addValue(rowMap.get("A"));

  B.addValue(rowMap.get("B"));

  C.addValue(rowMap.get("C"));

 }

}catch(Exception e){

 trace.addInfo(e.getMessage());

}finally{

 accessor.close()

}

댓글 없음:

댓글 쓰기