package zuoye;

import java.sql.Connection;
import java.sql.Statement;

public class text {
public static void main(String[] args) {
Connection conn =null;
Statement stat =null;
try {
conn = zuoye.getConnection();
String s = "insert into emp values(1016,'孙悟空',4,1004,'2018-12-17','8000.00',NULL,20)," +
"(1017,'孙悟空1',4,1004,'2018-12-17','8000.00',NULL,20)," +
"(1018,'孙悟空2',4,1004,'2018-12-17','8000.00',NULL,20)," +
"(1019,'孙悟空3',4,1004,'2018-12-17','8000.00',NULL,20)," +
"(1020,'孙悟空4',4,1004,'2018-12-17','8000.00',NULL,20)";
stat = conn.createStatement();
int i = stat.executeUpdate(s);
System.out.println(i);
if(i>0){
System.out.println("添加成功");
}else{
System.out.println("添加失败");
}
} catch (Exception e) {
e.printStackTrace();
}finally {
zuoye.a(conn,stat);
}
}
}
posted on 2019-04-02 08:30  ~王~  阅读(143)  评论(0编辑  收藏  举报