ITPub博客

首页 > > > 如果使用servlet+jdbc开发web程序,会有什么问题吗?

如果使用servlet+jdbc开发web程序,会有什么问题吗?

作者:choubou 时间:2019-10-12 15:21:09 0 删除 编辑

如果使用servlet+jdbc开发web程序,会有什么问题吗?、



我想用servlet+jdbc去写web程序

程序结构如下所示

这么写会出现什么问题吗

例如安全问题,性能问题

 

伪码如下

 class EmpServlet{

    
    EmpService empService = new EmpService();
     
    doGet(){
        //输入id查询emp对象
        empService.queryEmp(id);
    }
}

class EmpService{

    EmpDao empDao = new EmpDao();
    
    Emp queryEmp(id){
        return empDao.queryEmp(id);
    }
}

class EmpDao{

    Jdbc jdbc = new Jdbc();
    
    Emp queryEmp(id){
        return jdbc.query(sql,id);
    }

}



来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4548/viewspace-3167639/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-10-08

  • 博文量
    175
  • 访问量
    10707