我想设计一个包含多个输出区域的网页,这些输出区域将保存从 JDBC 结果集生成的数据

发布于 2024-10-10 00:20:29 字数 300 浏览 0 评论 0原文

我想设计一个包含多个输出区域的网页,这些输出区域将保存从 JDBC 结果集生成的数据。

我是一名 JAVA 新手,在大型机领域拥有 20 多年的软件开发经验。我进行了大量的 ISPF 开发。

现在,我正在寻找创建网页并在多个框架中显示 JDBC 输出所需的工具列表。我目前使用 eclipse 作为 JAVA 的 IDE。几年前,我编写了一段 JAVA 代码,用于获取结果集并在控制台中显示数据。现在我想进入 19 世纪并在网页中显示我的数据。我真的不确定从哪里开始。教程、书籍等,

任何指导将不胜感激。

谢谢RSJRNY

I want to design a web page containing multiple output areas which will hold data generated from a JDBC Resultset

I am a JAVA newbie with over 20 years of software development experience in the mainframe world. I do a ton of ISPF development.

now, what I am looking for is a list of tools necessary to create my webpage and display JDBC output in multiple frames. I currently use eclipse as my IDE for JAVA. I wrote a piece of JAVA code a few years ago that I use to get the Resultsets and display the data in the console. Now I want to move into the 19th Century and display my data in a web page. I am really unsure as where to start. Tutorials, Books, etc.

any guidance would be greatly appreciated.

thanks RSJRNY

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

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

发布评论

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

评论(1

少女净妖师 2024-10-17 00:20:29

ResultSet 永远不应位于用户界面的 100 码范围内。

您的分层应用程序应如下所示:

浏览器中的 HTML 页面 ----> servlet 监听 HTTP 请求 ----> 在这种情况下,数据库的接口

“接口”应该按字面理解:它是用于 CRUD 操作的 POJO 接口。不要返回 ResultSet;将查询结果映射到数据结构或对象中,并在方法范围内关闭 ResultSet。这是一种稀缺资源;您不应该将其传递出持久层。

一旦 servlet 从数据库获取对象或集合,就可以将其添加到响应中,以便用户界面可以获取它。

我假设您的 HTML 页面是使用 JSP 或 Velocity 等模板技术动态生成的。它们可以轻松地将数据库中的对象或集合添加到页面中。

这并不“容易”,但我认为这是正确的方法,无需框架大惊小怪。

A ResultSet should never get within 100 yards of a user interface.

Here's the way your layered application ought to look:

HTML page in browser ----> servlet listening for HTTP requests ----> interface to database

"interface" in this case ought to be taken literally: it's a POJO interface for CRUD operations. Don't return a ResultSet; map the results of a query into a data structure or object and close the ResultSet in method scope. It's a scarce resource; you shouldn't be passing that out of the persistence layer.

Once the servlet gets the object or collection back from the database, it's free to add it to the response so the user interface can get at it.

I'm assuming that your HTML page is generated dynamically using a templating technology like JSP or Velocity. They'll make it easy to add the object or collection from the database into the page.

It's not "easy", but I think this is the right way to do it without framework fuss.

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