Ed Ventura wrote:
Hans, are you talking about forwarding to a template page? Or an actual jsp
page that reads the database and displays the information?

Both ;-) I said that if you need to access the database in a JSP page, use JSTL instead of generated Java code; if you can, use a servlet for the database access which forwards to a JSP page (or some other template page, e.g. Velocity or Freemarker) that only displays the result.

Hans

From: Hans Bergsten <[EMAIL PROTECTED]>
Reply-To: A mailing list about Java Server Pages specification and reference
<[EMAIL PROTECTED]>
Date: Fri, 4 Apr 2003 11:21:13 -0800
To: [EMAIL PROTECTED]
Subject: Re: Crashing the web server.

Ed Ventura wrote:

Would anyone know what I could possibly be doing to bring down the web
server just by doing a database lookup? I�m using a jsp page that returns
the result set from a database and I�m consistently crashing our web server
(orion).

I�m using dreamweaver mx to pump out the jsp code but I doubt that
dreamweaver is putting out such bad code that it would be crashing the
server?!? Or maybe it is....

I mean, the code would have to be doing something pretty bad to actually
bring down a server, right?

Are you using a JDNC driver with native code (e.g. the JDBC-ODBC driver)? If so, it's not at all unlikely that the code generated by Dreamweaver MX causes the web server to crash. Simply doing things like working with multiple ResultSets in a manner that's not supported by the JDBC spec may cause serious enough errors in the native code that brings down the server. A pure Java JDBC driver reports the error instead. The JDBC-ODBC driver is also infamous for being buggy and is not intended for production use. If you use it, I suggest you find another driver. Most database vendors offer free pure Java drivers, and there are lots of commercial drivers available as well.

I also recommend that you use the JSP Standard Tag Libraries (JSTL)
database actions instead of letting Dreamweaver MX generate JDBC code
in your pages. It minimizes the risk for this type of problems and
keep the JSP pages easier to maintain. If you're a Java programmer,
an even better approach is to do all database stuff in a servlet
instead and forward to a JSP page that displays the result.

Hans
--
Hans Bergsten                                <[EMAIL PROTECTED]>
Gefion Software                       <http://www.gefionsoftware.com/>
Author of O'Reilly's "JavaServer Pages", covering JSP 1.2 and JSTL 1.0
Details at                                    <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 archives, FAQs and Forums on JSPs can be found at:

http://java.sun.com/products/jsp
http://archives.java.sun.com/jsp-interest.html
http://forums.java.sun.com
http://www.jspinsider.com


To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com


-- Hans Bergsten <[EMAIL PROTECTED]> Gefion Software <http://www.gefionsoftware.com/> Author of O'Reilly's "JavaServer Pages", covering JSP 1.2 and JSTL 1.0 Details at <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 archives, FAQs and Forums on JSPs can be found at:

http://java.sun.com/products/jsp
http://archives.java.sun.com/jsp-interest.html
http://forums.java.sun.com
http://www.jspinsider.com

Reply via email to