Meaningless Drivel is fun!*
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
Author

querying html/servlet

Wen Yen
Greenhorn

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?

Mahalo
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 688


Hi,

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
 
GeeCON Prague 2014
 
subject: querying html/servlet