It's hard to say without seeing your source but here's a couple of things to
look for.

Make sure you are closing all ResultSets and Statements.
Make sure you are NOT closing your Connection.

It would be helpful if you could give the Exception's message, type of DB,
etc. If you are going to have several simultaneous requests you should look
into a connection broker. There's one freely available at
http://www.javaexchange.com

Aaron

-----Original Message-----
From: Kenia Nimesh [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 04, 1999 11:04 PM
To: [EMAIL PROTECTED]
Subject: DriverManager.getConnection()


When I  make my database connection in the init() method I am  getting an
SQL Exception.
The  application runs fine  only once i.e for the first user . But
successive clients get an SQL Exception.Then if again I copy the servlet
file in the javawebserver It runs fine(Only once for the first user)

If I shift my code of class.forName() and DriverManager.getConnection() in
the service() method it runs fine for all the clients.

Please help me . Also suggest me the best place of writing the database
connection statements i.e in the init() method or service() method.

Nimesh

___________________________________________________________________________
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