关系管理系统:CustomerDaoimpl中添加用户代码delete()

public void delete(String id){
        Connection conn = null;
        PreparedStatement st = null;
        ResultSet rs = null;
        try{
            conn = JdbcUtils.getConnection();
            String sql = "delete from customer where id=?";
            st = conn.prepareStatement(sql);
            st.setString(1, id);
            
            st.executeUpdate();
        }catch (Exception e) {
            throw new DaoException(e);
        }finally{
            JdbcUtils.release(conn, st, rs);
        }
        
    }

 

posted @ 2013-07-07 11:04  亂舞春秋  阅读(226)  评论(0编辑  收藏  举报