Mittal:

I am not really clear on what you are trying to do, but I think the problem may be
because you are creating the connection in the init() method but destroying it in
perhaps a doPost. You may then be trying to access the destroyed connection again
in a subsequent doPost, which will not work. This is because code in the init()
method is executed just once at initialization time (and not every time a user
accesses the servlet via a doPost or doGet.) You may therefore want to get the
connection each time in the doPost by creating a connection pool in your init(0
method instead. Recent posts to this forum have recommended this link for more
information on connection pooling:
http://www.webdevelopersjournal.com/columns/connection_pool.html

Geeta

Mittal Shwetabh wrote:

> Dear All,
>
> Can anybody please let me know the reason behind gettng this exception:
>
> java.sql.SQLException: Io exception: A connection with a remote socket was
> reset
>  by that socket.
>
> Basically in my application(Java Servlets) I  already have a connection object
> (got during initialization)
> and in between  I  again need  to connect to database and then destroy this
> connection with some
> other user-id (who will log on through a login screen)to check that user
> validity.
> And then provide hyper link to application using my existing connection(got
> during initialization), if the
> user is authorised for it.
>
> The problem is that sometimes this link does not appear and the above
> exception is thrown...
> and sometimes it works fine...
>
> Environment:
> OAS8.0.4
> AIX4.1.2
> Oracle8.1.6
> jdbc driver
>
> Waiting for your reply.
>
> Regards
> Shwetabh Mittal
>
> ___________________________________________________________________________
> 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