开发者

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

I want to de开发者_运维问答sign 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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜