sql.append("insert into user(username,sex,email,passwd) values('");
sql.append(user.getUsername());
sql.append("',");
sql.append(user.getSex());
sql.append(",'");
sql.append(user.getEmail());
sql.append("','");
sql.append(user.getPasswd());
sql.append("')");
增:(注册)String sql = "insert into user(username,sex,email,passwd) values('" +user.getUsername()+"'," +user.getSex() +
",'" + user.getEmail() + "','" + user.getPasswd+"'";
删:String sql = "delete from user where id=" + id;
改:String sql = "update user set passwd='" + passwd + "',sex=" + sex + "where email='" + email + "'";
查:(登陆)String sql = "select * from user where username='" + username + "' and passwd='" + passwd + "'";
增:(注册)String sql = "insert into user(username,email,passwd,sex)values(?,?,?,?)";
查:(登陆)String sql = "select * from user where username=? and passwd=?";
查:(查询:多条信息)String sql = "select * from user";
查:(查询:一条信息)String sql = "select id from user where username='"+username + "'";
查:(判断信息是否唯一StateMent)String sql= "select id from user where "+volo+"='"+value+"'";
查:(判断信息是否唯一:PrepareStatement)String sql= "select id from user where "+ (type==0 ? "email=":"username=")+"?";
查:(mysql分页)String sql = "select * from user order by id desc limit "+startRow+","+size;
查:(oracle分页)String sql = "select * from (select rownum r,a.* from(select * from stu order by id desc) a) where r
between " + begin + " and " + end;