package zuoye;

import zuoye.zuoye;

import java.sql.Connection;
import java.sql.PreparedStatement;

public class text2 {
public static void main(String[] args) {
Connection conn =null;
PreparedStatement pre =null;
try {
conn = zuoye.getConnection();
String s="delete from emp where id=1020";
pre = conn.prepareStatement(s);
int i = pre.executeUpdate();
if(i>0){
System.out.println("删除成功");
}else{
System.out.println("删除失败");
}
} catch (Exception e) {
e.printStackTrace();
}finally {
zuoye.a(conn,pre);
}
}
}
posted on 2019-04-02 08:31  ~王~  阅读(619)  评论(0编辑  收藏  举报