DBUtils工具包参数化sql语句
public boolean validate(){
boolean flag = false;
QueryRunner runner = new QueryRunner(C3p0Utils.getDataSource());
try {
int num = runner.update("insert into user (name,password) values (?,?)");
if (num > 0){
System.out.println(name);
System.out.println(password);
flag = true;
}
} catch (SQLException e) {
e.printStackTrace();
}
return flag;
}
这种问题应该问么弄呢