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.
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
Joined: Oct 15, 2008
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.
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