Re: Fast retrieval and display of results to web browser
From: Christophe Vanfleteren (c.v4nfl3t3r3n_at_pandora.be)
Date: 11/20/03
- Next message: Tore Skogly: "Re: Oracle placeholder variables in jdbc"
- Previous message: Andre: "Re: Fast retrieval and display of results to web browser"
- In reply to: Andre: "Re: Fast retrieval and display of results to web browser"
- Next in thread: Michiel Konstapel: "Re: Fast retrieval and display of results to web browser"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 20 Nov 2003 15:12:02 GMT
Andre wrote:
> Thanks for your response. Yes, we do a ton of string concatenation.
> There's an uncountable number of lines of code that do something like:
> String html = "<table>";
> if(resultSet.getInt(1) == SOME_FLAG) {
> html += "<tr><td>blah blah</td></tr>";
> }
> html += "</table>";
>
> We actually do use taglibraries for SQL in some of our JSP's, but we
> haven't really found them very good for larger applications. This is
> how Sun feels about them too. I quote from the Java Web Services
> Tutorial:
>
> "The JSTL SQL tags listed in Table 17-7 are designed for quick
> prototyping and simple applications. For production applications,
> database operations are normally encapsulated in JavaBeans
> components."
Yes I know. But they also tell you not to generate your html inside the
classes itself :) That's why jsp was invented, because using plain servlets
was too tedious for html generation.
But if I were you, I'd definetly look for a better way of generating your
HTML. The way you're doing it now is very inflexible
Even just using scriplets inside a jsp where you process the resultset would
make your job a lot easier.
> Your point about String concatenation it well taken though. Thanks
> again for the response.
Replacing it with a StringBuffer should help a lot and will be the fastest
way you can improve performance.
-- Regards, Christophe Vanfleteren
- Next message: Tore Skogly: "Re: Oracle placeholder variables in jdbc"
- Previous message: Andre: "Re: Fast retrieval and display of results to web browser"
- In reply to: Andre: "Re: Fast retrieval and display of results to web browser"
- Next in thread: Michiel Konstapel: "Re: Fast retrieval and display of results to web browser"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|