hibername 호출 메모리 프로세스

1235 단어 저장 프로세스
JshxTaskDaoImpl

import java.sql.CallableStatement;
@Override
	public void callTaskManageProcedure() {
		List<Object> params = null;
		try {
			callProcedure1("{call TaskManager()}", params);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		//this.callProcedure("{call TaskManager()}", null);
		//this.callProcedure("TaskManager", null, null);
	}
	
	public void callProcedure1(String procString,List<Object> params) throws Exception {
		java.sql.CallableStatement stmt = null;
		try {
			stmt = (CallableStatement) this.getSession().connection().prepareCall(procString);
			if (params != null){
			int idx = 1;
			for (Object obj : params) {
				if (obj != null) {
					stmt.setObject(idx, obj);
				} else {
					stmt.setNull(idx, Types.NULL);
				}
				idx++;
				}
			}
			stmt.execute();
		} catch (SQLException e) {
			e.printStackTrace();
			throw new Exception("             [sql = " + procString + "]", e);
		}
	}

좋은 웹페이지 즐겨찾기