DeleteMail.java
上传用户:liangcc
上传日期:2019-05-24
资源大小:4412k
文件大小:1k
- package com.softeem.webmail.sendbox;
- import java.sql.Connection;
- import java.sql.PreparedStatement;
- import java.sql.SQLException;
- import com.softeem.webmail.dao.DBManager;
- public class DeleteMail {
- public void delete(int id){
- Connection con = DBManager.getConnection();
- String sql = "delete from mail where id = ?";
- try {
- PreparedStatement ps = con.prepareStatement(sql);
- ps.setInt(1, id);
- ps.execute();
- } catch (SQLException e) {
- e.printStackTrace();
- }finally{
- DBManager.closeConnection(null, null, con);
- }
- }
- }