Mbean에서 스토리지 프로세스 호출
5046 단어 Mbean
,table
/**
*
* @param actionEvent
*/
public void addDialogListener(ActionEvent actionEvent) {
try {
List<Row> selectRows = ADFUtils.getTableSelectedRows(richTable); //
if (selectRows.size() == 0) {
Noty.error(ErrorStringKey.UNSELECTROW_TIPS);
return;
}
String njdm = (String)ADFUtils.getSelectListValueOne("XtglJxdmjNjdmView1","Dm"); //
String xqdm = (String)ADFUtils.getSelectListValueOne("XqjbsjzlLov1","Xqdm"); //
String dwdm = (String)ADFUtils.getBoundAttributeValue("Ssdw");//
String zyfxdms = "";
for (Row row : selectRows) {
String zyfxdm = (String)row.getAttribute("Zyfxdm");
zyfxdms += zyfxdm+",";
}
dmjServiceAMImpl am = (dmjServiceAMImpl)ADFUtils.findIterator("XtglNjzyxxbVO1Iterator").getViewObject().getApplicationModule();
String stmt = "BEGIN XTGL_NJZYXXB_ADD(?,?,?,?,?); END;";
java.sql.CallableStatement st = null;
try {
st = am.getDBTransaction().createCallableStatement(stmt, 0);
st.setString(1, zyfxdms); //
st.setString(2, njdm);
st.setString(3, xqdm);
st.setString(4, dwdm);
st.registerOutParameter(5, Types.NUMERIC);
st.execute();
if(!st.getString(5).equals("0")){
ADFUtils.executeByOperation("Commit");
}
ADFUtils.findIterator("XtglNjzyxxbVO1Iterator").executeQuery();
JSFUtils.refresh(table);
JSFUtils.refresh(richToolbar);
JSFUtils.addFacesInformationMessage(ErrorStringKey.formInternationString(ErrorStringKey.BATCH_SCUUESS) + "," +
ErrorStringKey.formInternationString(ErrorStringKey.ADDNUM_TIPS) + st.getString(5));
} catch (java.sql.SQLException s) {
s.printStackTrace();
throw new oracle.jbo.JboException(s);
} finally {
try {
if (st != null) {
st.close();
}
} catch (java.sql.SQLException s2) {
throw new oracle.jbo.JboException(s2);
}
}
JSFUtils.closePopup(addPop);// pop
} catch (Exception e) {
log.severe(e);
Noty.error(ErrorStringKey.OPERATOR_ERROR);
}
}
create or replace procedure XTGL_NJZYXXB_ADD(p_zyfxdms in varchar2,
p_njdm in varchar2,
p_xqdm in varchar2,
p_dwdm in varchar2,
count_num out number) is
/**
*
* 2015 7 29
p_zyfxdms
p_njdm
p_xqdm
p_dwdm
*/
count_start number; --
count_end number; --
begin
select count(*) into count_start from xtgl_njzyxxb;
--
INSERT INTO xtgl_njzyxxb
(Njzydm,
Njzymc,
Nj,
Zyfxdm,
Sfxtzfx,
Sfqy,
Xqdm,
Ssdw,
Xz,
Pyccm,
Sfsd,
Zdzt)
SELECT p_njdm || Zyfxdm,
p_njdm || Zyfxmc,
p_njdm,
Zyfxdm,
Sfxtzfx,
'1',
p_xqdm,
p_dwdm,
Xz,
Pycc,
'0',
'0'
FROM XTGL_ZYFXXXSJZL
WHERE zyfxdm not in
(SELECT zyfxdm FROM xtgl_njzyxxb WHERE nj = p_njdm)
and zyfxdm in
-- regexp_substr , eg '1,2,3' '1','2','3' 。
(select regexp_substr(p_zyfxdms, '[^,]+', 1, rownum)
from dual
connect by rownum <=
length(regexp_replace(p_zyfxdms, '[^,]', null)));
--
select count(*) into count_end from xtgl_njzyxxb;
count_num := count_end - count_start;
end XTGL_NJZYXXB_ADD;
발췌문: 학년 전공 방향 정보 모듈