∪∩deniable Design

个人JAVA版GAE(google app engine),struts2+jpa+jQuery开发,互相交流 http://iunbug.appspot.com/

[简单]Java连接MySQL及防SQL注入

Posted on 2008-07-27 18:08 ∪∩BUG 阅读(1814) 评论(0)  编辑  收藏 所属分类: JSP学习笔记
(1)SQL注入获取用户密码:
1select * from student where Sno='0605030320' or '1'='1' and password='abc'
(2)设置参数在底层防止注入
 1/**
 2 * 
 3 */

 4package user.DAO;
 5
 6import java.sql.*;
 7
 8import user.entity.User;
 9
10