[scriptlets to execute JDBC inside a JSP]

>I'm working on adding metadata and other convenience methods now. I'll
>post the working example soon. Just wondering what similar solutions
>others might have found to handling JDBC queries within Struts.

The design I us works like this:
- for each logical item of data write a trivial class with all the
  get/set methods (the Entity class).
- for each such trivial data class write a likewise trivial class that
  does know how to map a ResultSet to the Entity class. Some SQL-Stmt
  merging code is added as well to tune the query (the Retriever class).
- for each logical query add a more or less trivial class that does the
  actual JDBC stuff (the Controller class).

For all of the above there exists base classes that make writing the
code very simple.

The Entity class can easily be exposed to Struts and used there.

Th Controller class is invoked from Action; if there is some initialization
to be done for a JSP create an action that's executed before the JSP is
actually displayed.


AFAICT the design outlined above does facilitate a better separation
between the underlying physical data model and the way this data is
represented to the user than can be achieved by using scriplets.

If anyone is interested I'd be willing to share the code (though I'd
have to check on copyright before).

Best,
Michael
--
 Vote against SPAM - see http://www.politik-digital.de/spam/
 Michael Gerdau       email: [EMAIL PROTECTED]
 Windows loading; please take a nap...
 PGP-keys available on request or at public keyserver


Reply via email to