首页 > 其他 > 详细

课堂听写7

时间:2019-06-12 10:16:46      阅读:130      评论:0      收藏:0      [点我收藏+]

action 或a标签发起请求 get 提交premiter    

poth以<input type="hidden" name=" ">

a标签通过拼接的方式

<a href "">

setrevlet requset.getprogmter

 

 

 

request.getParameter("参数名");

获取一个参数对应的多个值:String [] name=request.getParameterValues("参数名");

 

把参数传递给service,调用service的方法实现业务处理

 

创建service接口,public interface jiekou{};

抽象方法,public 返回值类型 方法名(参数);

创建接口实现类,实现接口,重写接口内的方法

实例化dao接口,调用dao内方法处理数据

处理数据时,返回值总是ResultSet类型,必须用rs.next()方法,时间格式:rs.getTimestamp



作者:舒眉问卷
链接:https://www.jianshu.com/p/74d688c8a7c6
来源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。

 

获取数据,实例化dao

 

Class.fromName("com.mysql.jdbc.Driver")

Connection conn= DriverManager.getConnection("jdbc:mysql://localhost:3306/lyd01","root","root");

Statement stmt=conn.createStatement();

int count=stmt.executeUpdate(sql);

return rs.next();


response.sendRedirect(request.getContextPath()+"/userListServlet");

request.getRequestDispatcher("/list.jsp").forward(request,response);
 



 

课堂听写7

原文:https://www.cnblogs.com/liyado/p/11007935.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!