Peter Pilgrim wrote:
>
> Hans
>
> Thanx. I was thinking along the first option line myself.
>
> I realised that a lot of the reporting in my current project in either HTML, CSV, XML
> could be put in a separated JSPs, after I moved DB code to a separate Servlet.
>
> I could make the Servlet perform the DB SQL Query with the SQL Command Bean
> then put the bean and resulting rowset data in request scope. Afterwards I forward
> to the required ``reporting JSP'' according the requested report type.
> Et Voila! !Estupendo! On the way Generic reporting!
Yes, using a servlet for the database stuff is even better if you know Java
programming. Using a JSP page, with a set of database custom actions, works
fine for simple cases though, and may be the only option for a developer that
isn't a hardcore Java programmer.
> Yes Hans, I copied your SQL Command Bean ( I did not subclass because the class
> data members were "private" ) and made it work with Expresso Framework's
> (www.javacorporate.com) `DBConnection' object. Unfortunately the
> `DBConnection' in Expresso 2.20 does not support `PreparedStatement' objects yet!
> The other thing I added was access to the ResultSetMetaData indirectly.
> I needed to know the column labels, names, and possible the type names of the Row
> data. This is where the "Vector [] getColumnNameList()" bean method comes from.
> It probably be extended also to get the more RSMD stuff like the "Precision", "Scale"
> but this might be overkill for some projects me think.
Great. When I developed the classes for the book, I did not intend to create
a framework, so that's why it may not be possible to just extend them. But
as you have found out, they can be used as a starting point for your own
classes, and they give you an idea for how to develop classes for similar cases.
> "I am glad I bought your book. Yours is the most immediately useful JSP book
> I have come across so far."
I'm very glad to hear that. Thanks!
Hans
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets