336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

안녕하세요.

 

참고 프로시저

1
2
3
4
5
6
7
8
9
10
11
12
13
CREATE OR REPLACE PROCEDURE pro_testTableSel(
varIdCol IN OUT NUMBER,
varNameCol OUT VARCHAR2,
varValueCol OUT VARCHAR2)
IS
 
BEGIN
    SELECT idCol, nameCol, valueCol
    INTO varIdCol, varNameCol, varValueCol
    FROM testTable
    WHERE idCOl = varIdCol;
 
END pro_testTableSel;
cs


 


home.jsp

1
2
3
4
5
프로시저 실행 <br/>
<form name="procedureForm" id="procedureForm" method="POST" action="./springProcedure.do">
    <input type="text" value="2" id="idCol" name="idCol"/>
     <input type="submit" value="프로시저 호출" />
</form>
cs


HomeController.java

1
2
3
4
5
6
7
8
9
10
11
@RequestMapping(value = "/springProcedure.do", method = RequestMethod.POST)
    public void springProcedure(HttpServletRequest request){
        
        //request Map은 수정이 불가능해서 따로 담아서 Procedure 처리
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("IDCOL", Integer.parseInt(request.getParameter("idCol")));
        
        logger.info("map check : "+map.toString());
        
        homeService.getProcedureSel(map);
    }
cs


HomeService.java

1
public void getProcedureSel(Map<String, Object> map);
cs


HomeServiceImpl.java

1
2
3
4
5
6
@Override
    public void getProcedureSel(Map<String, Object> map) {
        homeMapper.testDbProcedure(map);
        
        logger.info("map Check ServiceImpl : "+map.toString());
    }
cs


HomeMapper.java

1
public void testDbProcedure(Map<String, Object> map);
cs


testMapper.xml

1
2
3
4
5
6
7
8
<!-- 프로시저 (NUMBER -> NUMERIC 문자열(VARCHAR)) -->
    <select id="testDbProcedure" parameterType="java.util.Map" statementType="CALLABLE">
        CALL pro_testTableSel(
        #{IDCOL, mode=INOUT, jdbcType=NUMERIC, javaType=Integer},
        #{NAMECOL, mode=OUT, jdbcType=VARCHAR, javaType=String},
        #{VALUECOL, mode=OUT, jdbcType=VARCHAR, javaType=String}
        )
    </select>
cs

 

결과



감사합니다.

'SPRING' 카테고리의 다른 글

SPRING PROCEDURE 사용하기 2  (0) 2019.04.01
SPIRNG EXCEL UPLOAD 하기  (1) 2019.04.01
SPRING FILE DOWNLOAD하기  (0) 2019.03.28
Spring FileUpload 하기  (0) 2019.03.28
Spring Excel down하기  (0) 2019.03.28

+ Recent posts