Could someone please please help me with my connection pooling? I have been trying for a while now with no success.
Below is my jsp file that I use for my database connection.
I need someone to help me with the codes that will make this file implement connection pooling.
Your help shall be very much appreciated.
I have edited web.xml and server.xml
Joined: Oct 08, 2006
For starters: do not write Java code in JSP files. Write Java code in Java classes. Doing so in JSP is receipt for trouble.
To use connection pooling, just create a datasource in the application server get a connection from it and handle it the usual way (acquire and close connection/statement/resultset in the shortest possible scope in a try/finally block). How to create a datasource is covered in the documentaiton which came along with the appserver in question. If it is for example Tomcat, you can find here such a document: http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html
Thank you so much for your response. Here is what I have done
I added the in C:\Tomcat\conf
Now this is far as I can go. I am a beginner and I really dont know much.
The system is due but this part is the only thing holding me back.
If you may please help me with the code that I should add that will allow
the connection pooling. If you could help I would be the happiest person ever.
I am not good with java so if I can work with JSP its best.
Joined: Jan 29, 2009
you have send server.xml and web.xml along with source code. please also tell what problem you are facing means the output error log you are getting with the application.
Joined: Nov 06, 2000
As mentioned, following the server's documentation is straight forward. And you do not want to be doing this from your jsp. The jsp is your presentation layer and should not have any code. If you are not good with Java, then you will likely run into trouble if you put all that code in your jsp.
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley