Asim:

There's something quite similar to this in our Expresso framework (at
http://www.javacorporate.com). We've got a servlet that handles
login/session tracking, and a general "search" servlet (e.g. search for a
file with specific content) as well as a number of Query servlets that
access the database. If an example might help with your development, feel
free to download a copy - it's open source. The way we've tackled the
problem you describe is with a generalized connection pool, that is
initialized when the first connection is needed & grows as required to some
maximum (set by either your DB or your host). The connection pool holds
connections ready, so when login, search, or anything else requests a
connection, it simply hands it one, already connected & ready to go. The
user's login is not used to connect to the database, as security is handled
seperately from the DB login. Otherwise, you've got to wait for a new
connection, then hold it open between invokations of the servlets - gets
messy in a hurry.

I'm sure there are many ways to do it, but hopefully an example helps.

Mike
Javacorporate Ltd

-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Imam,
Asim, CFCTR
Sent: Wednesday, September 01, 1999 2:10 PM
To: [EMAIL PROTECTED]
Subject: Re: Passing Connection Objects from servlets to JSP??


Hey All,

Due to my limited knowledge I think I kinda asked the wrong question. I
appologize...Let me try again:

Heres what I am trying to do and I want to know the BEST way to implement
it:

I have a login page(html/servlet or jsp??), a search page(html) and a
results page(JSP)

Login Page...username and password...from this I want to instantiate my
connection to DB
search page..has three fields that I want to query on.. the submit button
calls the result page
results page(jsp)...has a query bean which gets the params from search page,
performs query and displays result

Now my question is how do I access the connection object I instantiated when
I logged in... Do I have a bad design???

Simply what I want is the user logins in...is send to a search page where
he/she performs a query and the results are displayed???

What would be the best approach/design to do this using
JSP/Servlets????????? I need guidance desperately.....

Many Many thanx to all for being such patient with me and helping me out.

Asim Imam
Application Developer
@AT&T Tax Systems Group

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to