1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

JSP to mainframe DB2--global connection?

Discussion in 'JSP' started by mhb22079, Jul 9, 2010.

  1. mhb22079

    mhb22079 New Member

    Jul 9, 2010
    Likes Received:
    Trophy Points:

    I've built some JSP pages on my corporate Tomcat server that successfully attach to DB2 however the performance is pretty bad. I'm using JDBC. I believe it is related to opening and closing the connection multiple times but am unsure how to proceed.

    My site uses 3 vertical frames (header, menu, and content pages) accepts several fields from a user and executes a DB2 query based on the data entered. A submit button calls the same JSP and displays the result of the query.

    The issue I am having is that it seems that on each load of the JSP the connection seems to be automatically closed. If I open the connection on the first load of the JSP (when called from menu) and don't close it, on the query when the page is called again I get a Null pointer exception.

    Sorry to be so wordy but I'm a mainframe programmer and pretty new to the workings of JSP and database connections. I would greatly appreciate any guidance as the best means to handle a database connection that would span multiple JSP pages (or the same JSP called to return results).


Share This Page