Re: ResultSet processing/closure in JSP

From: numen (numen_at_localhost.localdomain)
Date: 01/28/05


Date: Fri, 28 Jan 2005 15:32:49 +0500

one thing that i use it that i create two methods one to open the
connection an on to close.
now from my jsp i call the open method using an object of same class do th
processing and then call the closing method.
allthough i don't know whether it is correct to do or not

 On Tue, 11 Jan 2005 15:11:07
-0800, Simon wrote:

> Hi,
>
> I am trying to understand the implications of processing a ResultSet
> in a JSP given that the ResultSet is created in a servlet, and then
> placed in the request to provide access to the JSP.
>
> My confusion is how the closure of the ResultSet is managed. I am
> aware that the standard procedure would be to open a connection,
> execute a statement, and then process the results, before closing the
> connection, statement, and result set in the servlet code. As the
> ResultSet object is required by the JSP where should I handle closing
> it? It seems very messy to create the ResultSet in the servlet, and
> then close it in the JSP.
>
> Any thoughts/suggestions are much appreciated.
>
> Thanks,
> Simon



Relevant Pages

  • Re: ResultSet processing/closure in JSP
    ... > I am trying to understand the implications of processing a ResultSet ... > placed in the request to provide access to the JSP. ... > connection, statement, and result set in the servlet code. ...
    (comp.lang.java.programmer)
  • Re: db woes big time... resolved -- actually...
    ... > the API for HttpServletResponse & look at the setContentTypemethod. ... book from where I took this is actually neither a servlet or a jsp, ... here's entire code for a jdbc connection from the book, ...
    (comp.lang.java.help)
  • Re: ResultSet processing/closure in JSP
    ... > I am trying to understand the implications of processing a ResultSet ... > placed in the request to provide access to the JSP. ... > execute a statement, and then process the results, before closing the ... > connection, statement, and result set in the servlet code. ...
    (comp.lang.java.databases)
  • Re: JSP, Servlets & AJAX username validation, Image verification
    ... It's got scriptlet in the JSP and HTML in the Java source code. ... Most DB connection pools do not require the code to explicitly know of the pooled nature of the connections, but just have the connection call its closemethod. ...
    (comp.lang.java.programmer)
  • Re: Connection Pooling for multiple JSPs
    ... > I'm not sure how to reap the same benefits with multiple JSP pages. ... connection pool on initialization and then provides a facade to it (i.e. ... datasource that simply call the corresponding methods from the datasource). ... You probably want the method getInstance to read a properties file that ...
    (comp.lang.java.help)