File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes querying html/servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "querying html/servlet" Watch "querying html/servlet" New topic

querying html/servlet

Wen Yen

Joined: May 01, 2009
Posts: 4
Hi guys,

I have a servlet that currently queries from an oracle database and a wicket that creates the connection to the servlet using the java.url package.
Is there a way to maybe save an instance of the servlet and get the results that way or directly through the connection made using java.url?

Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 689


First you remove your database connection code from your servlet to another POJO java class.

That java class contains only your business logic. make object of your java class and call method from your servlet.

That makes your code better and make better maintainable.

So, seprate your business logic from servlet controller to another java class model.

And then get result pass through the request object and forward to jsp.

Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
I agree. Here's the link:
subject: querying html/servlet
It's not a secret anymore!