jsp查询、插入、修改、删除的excute语句

1.查询

String sql="SELECT * FROM "+tableName;

rs.executeQuery(sql);
2.插入

String sql1="insert into userinfo values('1005','崔玉洁','女','1996-05-21','游泳')";
s.execute(sql1);

3.修改

String sqlU="UPDATE userinfo set Name='高宏伟' where UserId='1002'";

s.executeUpdate(sqlU);
4.删除

String sqlD="delete from userinfo where UserId='1003'";

s.execute(sqlD);





你可能感兴趣的:(jsp)