//mysql通用增删改
public void update(String sql,Object...args){
Connection conn= null;
PreparedStatement ps=null;
try {
conn=JDBC_curd.getConnection();
// 预编译sql
ps=conn.prepareStatement(sql);
// 填充占位符
for (int i = 0; i < args.length; i++) {
ps.setObject(i+1,args[i]);
}
// 执行
ps.execute();
} catch (SQLException throwables) {
throwables.printStackTrace();
}finally {
JDBC_curd.closeConnection(conn,ps);
}
}
}