맞춤검색


1. SQL XML 파일구조. 
  - DTD 파일참조. http://chalranjdbccomp.sourceforge.net/caf-dbmanager-2.0.dtd
  - 서버 Deploy 시는 반드시 삭제하거나, 해당 서버의 dtd url 로 변경할 것.

2. type 설명.
  - sql  : sql에 해당하는 쿼리를 실행함.
- 추가적인 Attribute ( select 인경우 )
   firstResult - 미지정시 0번째 ResultSet 부터 데이타를 가져옴.
   maxResults - maxResults 로 정의한 갯수만큼 데이타를 가져옴.
   randomResults - randomResults 에 해당하는 갯수만큼 랜덤 데이타를 가져옴.
  - uid  : 해당하는 쿼리실행후 해당컬럼에 변수명으로 사용가능.
  SEQ 채번의 경우, 자주 사용함. 
  dbmanager가 실행하고 있는 동안은 글로벌 변수로 이후 쿼리 실행시 사용가능함.
  Q_com_sample.xml 파일     참조.
  - proc  : 프로시저 실행. 
  OUT 변수가 CURSOR, 숫자, 문자로 리턴받을 수 있음. 
  숫자, 문자의 경우는 uid 타입과 마찬가지로 글로벌 변수 형태로 이후 쿼리 실행시 사용가능함. 
  Q_com_sample.xml 파일참조.
  - xlob  : CLOB, BLOB 갱신시 사용하는 type. 
  - call_sqlid  : 해당쿼리시 실행후, sqlid 컬럼의 문자열값에 해당하는 sql id 를 다시 호출함.
 ex) SELECT DECODE( COUNT(*), 0, 'insert', 'update' ) sqlid FROM DUAL
     설명 : COUNT가 0이면 
        <sql id="insert">
    아니면 
        <sql id="update"> 
    를 다시 호출함.
Q_com_sample.xml 파일예시
			
				
					
						select nvl(max(seq)+1,1) seq from com_sample
					
					
						INSERT INTO COM_SAMPLE ( seq,user_id,user_nm,pwd,rrn,birth_day,max_number,min_number,self_desc,f_id,regr_id,reg_tm,updr_id,upd_tm,html_desc )
						VALUES (  @@seq , @@user_id , @@user_nm , @@pwd , @@rrn , @@birth_day , @@max_number , @@min_number , @@self_desc , @@f_id , @@regr_id ,to_date( @@reg_tm ,'yyyy-mm-dd hh24:mi:ss'), @@updr_id ,to_date( @@upd_tm ,'yyyy-mm-dd hh24:mi:ss'), empty_clob()  )
					
					
						SELECT html_desc
						FROM COM_SAMPLE
						WHERE SEQ = @@seq
						FOR UPDATE
					
				
				
					
						UPDATE COM_SAMPLE
						SET
							USER_ID = @@user_id,
							USER_NM = @@user_nm,
							PWD = @@pwd,
							RRN = @@rrn,
							BIRTH_DAY = @@birth_day,
							MAX_NUMBER = @@max_number,
							MIN_NUMBER = @@min_number,
							SELF_DESC = @@self_desc,
							HTML_DESC = empty_clob() ,
							F_ID = @@f_id,
							REGR_ID = @@regr_id,
							REG_TM = to_date(@@reg_tm,'yyyy-mm-dd hh24:mi:ss'),
							UPDR_ID = @@updr_id,
							UPD_TM = to_date(@@upd_tm,'yyyy-mm-dd hh24:mi:ss')
						WHERE SEQ = @@seq
					
					
						SELECT html_desc
						FROM COM_SAMPLE
						WHERE SEQ = @@seq
						FOR UPDATE
					
				
				
					DELETE FROM COM_SAMPLE
					WHERE SEQ = @@seq
				
			


3. 특수문자설명. ( 자체SQL-Parser 사용)
  [ ] - 선택적으로 조건절을 추가하고자하는 경우 사용함.
  [ ] 문자 사이에 해당변수명이 값이 들어온 경우만 실행SQL에 append 됨.
  { } - [ ] 문장이 여러개 있는 경우, 예를 들어 a, b, c 의 변수가 들어오는 경우.
  선택적으로 들어오므로, { } 문자사이에 들어있는 최종 문자에 대하여, 
  AND -> WHERE 로 변환하는 역할을 함. 
  @@변수명 - PrepareStatement 방식으로 변수명을 setString 함.
  @!변수명 - 직접 실행하고자하는 SQL을 만들어 실행함. 


4. dbmanager 사용방법은 JAVADOC을 참조.
Tracked by ClickAider