> I have developed a servlet web application which
> connects to a database to retrieve information. I
> noticed that if within my servlet I destroy the
> connection to the database there is no way to
> reconnect to the database .
Maybe this is a JSP thing (I'm not too familiar with those), and JSPs have
some weird JDBC cover methods. But you _should_ be able to disconnect, by
calling Connection.close(); and to reconnect, the same way you connected the
first time.
Why can't you reconnect? Are you getting an exception from
DriverManager.getConnection()?
> Is keeping the persistent connection to the database
> a heavy burden on tomcat?
Persistent connections aren't a burden on Tomcat, but might be on your
database, especially if the modifications aren't committed immediately. You
should always try to close connections (and other resources) if you don't
think you'll be using it again in a few seconds.
> I don't believe my question pertains specifically to
> Tomcat, so I was wondering whether or not any of you
> knew where there are list servers which deal with
> servlets in general.
This mailing list is fine for general servlet questions. But this seems to
be a JDBC question,...
-- Bill K.
> -----Original Message-----
> From: A.L. [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 07, 2001 9:07 AM
> To: [EMAIL PROTECTED]
> Subject: Servlet/ Database Conenction Persists Question
>
>
> I have developed a servlet web application which
> connects to a database to retrieve information. I
> noticed that if within my servlet I destroy the
> connection to the database there is no way to
> reconnect to the database . In other words I need to
> keep my connection to the database at all times that
> tomcat is up. My questions include:
>
> Is this correct that there is no way to reconnect to
> the database? If this is not correct, how does one
> reconnect, and or reinitialize the servlet?
> Is keeping the persistent connection to the database
> a heavy burden on tomcat? In other words, is it o.k.
> to design an application which never releases its
> conenction to the database?
>
>
> I don't believe my question pertains specifically to
> Tomcat, so I was wondering whether or not any of you
> knew where there are list servers which deal with
> servlets in general.
>
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with
> Yahoo! Messenger
> http://phonecard.yahoo.com/
>