时间:2021-07-01 10:21:17 帮助过:45人阅读
public class DemoForWriteApp {
public static void main(String[] args) {
// testInsert();
// testUpdate();
testDelete();
}
private static void testDelete() {
String sql = "delete from tb_user where id=?";
List<Object> params = Lists.newArrayList();
params.add(7);
int rows = DemoForWrite.modify(sql, params);
System.out.println("rows = " + rows);
}
private static void testUpdate() {
String sql = "update tb_user set name=?,age=? where id=?";
List<Object> params = Lists.newArrayList();
params.add("hehehehe");
params.add(67);
params.add(5);
int rows = DemoForWrite.modify(sql, params);
System.out.println("rows = " + rows);
}
private static void testInsert() {
String sql = "insert into tb_user(name,age) values(?,?)";
List<Object> params = Lists.newArrayList();
params.add("xixihaha");
params.add(34);
int rows = DemoForWrite.modify(sql, params);
System.out.println("rows = " + rows);
}
}
jdbc-db连接和业务调用方发分离
标签:except modify dstat sts delete etc oid system app