File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes proper way to display the result of a SQL query in my servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "proper way to display the result of a SQL query in my servlet?" Watch "proper way to display the result of a SQL query in my servlet?" New topic
Author

proper way to display the result of a SQL query in my servlet?

John Piper
Greenhorn

Joined: Mar 27, 2011
Posts: 12
I keep getting stuck on this.

Here is my servlet:



I'd like to know the correct way to post the result of this query in the servlet:


after the is


If someone could provide me that information you will seriously make my night. Thanks everyone.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3838

What's the output you get now? Do you know how to access a result set data? And there seems to be some mismatched tags like <table> in your code...

And just as writing Java code inside JSPs is a bad practice, writing HTML inside Servlets also outdated. So as an enhancement you may consider moving your display logic in to JSPs and the data access logic to POJOs or any other alternative.


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
 
Consider Paul's rocket mass heater.
 
subject: proper way to display the result of a SQL query in my servlet?