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

Reply via email to