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

Leave a Reply

error: Content is protected !!