sql结果集输出JSP页面

发布于 2024-09-28 04:00:14 字数 155 浏览 1 评论 0原文

我在模型类中触发了一个 sql 查询,它返回用户数据表。现在我需要在我的视图页面(JSP)上显示结果。我不想从 JSP 页面触发 sql。如何将结果集传递给 JSP?我是否需要构建一个集合集并将其传递给 JSP 或者是否有更好的方法来做到这一点?

谢谢,

-维杰

I have a sql query fired in my model class which returns a table of user data. Now i need to display the result on my view page (JSP). I don't want to fire the sql from JSP page. How do i pass of the result set to JSP? do i need to construct a collection set and pass it on to the JSP or is there any better way to do it?

Thanks,

-Vijay

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

魂ガ小子 2024-10-05 04:00:14

如果您使用 import,请使用请求范围从一个 jsp 传递到另一个 jsp
最差情况下使用会话范围,但很容易出现内存泄漏。

use the request scope to pass from one jsp to another if you are using import
in the WORST case use the session scope but you will be prone to memory leak.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文