Hi Friends, I am trying to use the Tomcat Data Sources,connection pooling.The example I saw used servlets,can you please tell me how to change the servlet to equivalent java code,as i dont know servlets.I have marked(----) the statements,which need to be changed.I have marked the last one(return results),because I dont know where to fit that statement.
Jas, Connection pooling uses a datasource. This works if your class runs on the server (servlet, ejb, ...) It also works if a servlet or ejb is calling your class. If this is not the case, you need to substitute the part of the code that gets the connection with the DriverManager code (from your other post.)
As for returning the resultset, I'm not sure what the confusion is. Are you trying to process it?
Thanks jeanne again, I have a jsp,which fires in the query to this class,which returns the resultset to another java class,which cooks the data and sends it back to the jsp.I have worked on the code,I just want to know when and where should I call the close() method.Here's my new code:
"which returns the resultset to another java class,which cooks the data" - This is the class that needs to call your newly written close method.
Joined: Jan 16, 2005
Thanks Jeanne, After making changes to Tomcat and configuring the connection pool,I am able to reduce the database access time vastly.But there is still a delay,how can i check the no.of connections that are open,because i am not calling the close routine anywhere.Please help me again.