
servlet配置到你的wedxml中。
从数据库中获取到的数据放进响应中然后通过%=requestgetAttribute("bookId1") %获取对应的值当然仅仅有servlet和jsp页面是不够的还须要的是servlet配置到你的wedxml中。这样servlet才干够使用。
具体代码如下:
package bookConnUtil;
import javaioIOException;
import javasqlSQLException;
import javaxservletServletException;
import javaxservlethttpHttpServlet;
import javaxservlethttpHttpServletRequest;
import javaxservlethttpHttpServletResponse;
public class selectBook extends HttpServlet {
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
// TODO Auto-generated method stub
以上就是关于连接数据库进行查询,怎样把查询到的结果在jsp中显示,在servlet使用Dao中的方法是什么全部的内容,包括:连接数据库进行查询,怎样把查询到的结果在jsp中显示,在servlet使用Dao中的方法是什么、、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)