본문 바로가기
코딩 저장용

[자바(java)] map에 리스트담아서 오라클 업데이트 하는법

by 디지털프리덤 2018. 8. 31.
반응형


list에 값 담은다음


//맵 선언뒤

HashMap map = new HashMap();


//맵에다 리스트를 담는다.

map.put("list", list);


다음 SQL(오라클)에서 

<update id="id" parameterType="java.util.HashMap">

update table_name

     set 

//set부분에  foreach문을 써준다.

    <foreach collection"list" item="item" index="index">

~~~~~~

    </foreach>

 where 1=1

</update>


성공~~!!

반응형