Category: Java

자바 개발 관련 카테고리입니다.

Java

[AES 256] crypto Cipher 사용하기

import java.security.InvalidAlgorithmParameterException;import java.security.InvalidKeyException;import java.security.NoSuchAlgorithmException;import java.security.spec.AlgorithmParameterSpec;import javax.crypto.BadPaddingException;import javax.crypto.Cipher;import javax.crypto.IllegalBlockSizeException;import javax.crypto.NoSuchPaddingException;import javax.crypto.spec.IvParameterSpec;import javax.crypto.spec.SecretKeySpec; public class AES256Cipher {      public static byte[]...
Java

(iBATIS)아이바티스 IN절 사용법 (iterate 사용)

[Server side 코드] var idList = new List();  idList.Add(10); idList.Add(12); [아이바티스 내 사용법]    < select id=”GetLogin”  parameterClass=”cusstomParam” resultClass=”int” >       SELECT DISTINCT StudentName       FROM STUDENT       WHERE Year = #Year#       < isNotEmpty property=”AgencyYn” prepend=””>         < isEqual property=”AgencyYn” prepend=”AND” compareValue=”Y”>           < iterate prepend=”” property=”IDList” open=”AgencyID IN (” close=”)” conjunction=”,”>             #IDList[]#           < /iterate>         < /isEqual>       < /isNotEmpty>     < /select>
Java

(iBATIS)아이바티스 사용시 주의사항

$기호는 절대 쓰면 안된다. 왜냐하면 SQL인젝션이 가능해지기 때문이다. [잘못된 사용법]select distinct LibID from Student where student_name like ‘%$SearchText$%’ [올바른 사용법]select distinct LibID from Student where student_name like ‘%’ + #SearchText#+’%’   꺽쇠(<,>)기호 사용시 CDATA를 사용해야한다.select distinct LibID from Student where student_id <! [CDATA[ < ]] > 100