wood burning stoves 2.0*
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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: 684


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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: querying html/servlet
 
Similar Threads
Request a simple example of persistance using servlets
how do transfer data from one server to another server
Values not retrieved from the DB
Handling an Ctrl-C in an Servlet
JDBC in JSP/Servlet question