달력

112017  이전 다음

  •  
  •  
  •  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  •  
  •  

resin.conf에 아래와 같이 추가해주던가....

    <system-property javax.xml.parsers.DocumentBuilderFactory="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl" />
    <system-property javax.xml.parsers.SAXParserFactory="org.apache.xerces.jaxp.SAXParserFactoryImpl" />
    <system-property javax.xml.transform.TransformerFactory="org.apache.xalan.processor.TransformerFactoryImpl" />
    <system-property org.xml.sax.driver="org.apache.xerces.parsers.SAXParser" />


아니면 다음과 같이 리스너를 구현한다.

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class XmlTranslateListener implements ServletContextListener {

 public void contextInitialized(ServletContextEvent arg0) {
 
  System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
  System.setProperty("javax.xml.parsers.SAXParserFactory","org.apache.xerces.jaxp.SAXParserFactoryImpl");
  System.setProperty("javax.xml.transform.TransformerFactory","org.apache.xalan.processor.TransformerFactoryImpl");
  System.setProperty( "org.xml.sax.driver",  "org.apache.xerces.parsers.SAXParser" );
 }
   

 public void contextDestroyed(ServletContextEvent arg0) {
  // TODO Auto-generated method stub

 }

}

신고
Posted by Tornado tornado


getSqlMapClientTemplate().execute(new SqlMapClientCallback() {
    public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException {
       executor.startBatch();
             
        while(....){
           // job....

        }

         return new Integer( executor.executeBatch()) ;    
    }
   });
신고
Posted by Tornado tornado

원문 : http://blog.naver.com/jkhljesus?Redirect=Log&logNo=70016617377



여기저기 자료를 참고하며 고생끝에 해결 했네요.. ㅋ

iBatis 의 SqlMaps 를 이용 시 IN 절을 동적으로 생성할 때 처리하는 방법

IN절 이외에도 Dynamic SQL 구문 작성 시 유용할 듯 합니다.


XXX.java
--------------------------------------------------------------------------

List list = new ArrayList();
list.add(id);
list.add(id);


Map map = new HashMap();
map.put("listId",list);

return (Map) sm.getItem("em.ss.board.getBoardDetail", map);

XXX.xml

--------------------------------------------------------------------------

 <!-- CLOB Data 조회를 위한 정의  -->
 <resultMap id="getClobBoardData" class="hmap">
         <result property="TITLE" column="TITLE"/>
        <result property="CONTENT" column="CONTENT" typeHandler="clobHanlder"/>
</resultMap>


<select id="getBoardDetail" parameterClass="map" resultMap="getClobBoardData">
   SELECT  TITLE
               , CONTENT
   FROM TEX_BULLETIN_H
   WHERE ID
     <iterate prepend="IN" property="listId" open="(" close=")" conjunction=",">
       #listId[]#
     </iterate>  
         
</select>


신고
Posted by Tornado tornado