Statement跟PreparedStatement的区别
1:PreparedStatement是Statement的子类;
2:PreparedStatement可以防止sql注入(将(')进行转移);
3:PreparedStatement预编译sql语句,而Statement则是每次都要在数据库中进行编译,使用PreparedStatement可以减轻数据库的压力
1:PreparedStatement是Statement的子类;
2:PreparedStatement可以防止sql注入(将(')进行转移);
3:PreparedStatement预编译sql语句,而Statement则是每次都要在数据库中进行编译,使用PreparedStatement可以减轻数据库的压力