This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
The Tomcat docs also have very good instructions for setting up DBCP, including sample code.
Bhaskar Rao
Greenhorn
Joined: Apr 25, 2005
Posts: 23
posted
0
Hi,
I had faced a similar issue wherein the method DataSource.getConection() would simply hang forever without any response. My development environment had Tomcat 5.0, Connector/J 5.1.6 and MySQL 4.0.
The problem was with the MySQL connector. The Connector/J version that I used was incompatible with the version of MySQL server. I then used Connector/J 5.0.8 which resolved the problem.
Thank you so much for your help. however, i am going round in circles. i am trying to test my connection with the page below but I am getting an error i have also included after the code. Please assist if you can see where the error is and how it can be solved::
<% foo.myWeb tst = new foo.myWeb(); tst.init(); %>
<h2>Results</h2> Foo <%= tst.getFoo() %><br/> Bar <%= tst.getBar() %>
</body> </html> /*********************The End of Code************************/
/***************************The Error**************************/ org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 2 in the jsp file: /myWeb/test.jsp Generated servlet error: C:\Tomcat5027\work\Catalina\localhost\_\org\apache\jsp\myWeb\test_jsp.java:52: illegal start of expression package foo; ^
An error occurred at line: 2 in the jsp file: /myWeb/test.jsp Generated servlet error: C:\Tomcat5027\work\Catalina\localhost\_\org\apache\jsp\myWeb\test_jsp.java:58: illegal start of expression public class myWeb { ^
An error occurred at line: 2 in the jsp file: /myWeb/test.jsp Generated servlet error: C:\Tomcat5027\work\Catalina\localhost\_\org\apache\jsp\myWeb\test_jsp.java:58: ';' expected public class myWeb {
/************************End of Errors***************************/
"Summer Breeze", My request that you change your display name to adhere to JavaRanch standards was not a suggestion. Valid display names are mandatory for participation on the Ranch. Please change your display name as instructed prior to your next post.
Be aware that accounts with invalid display names are disabled.
Don't package JSPs, and don't declare classes in them either. As a general rule, if you need processing, make a Class, if you need display, use a JSP. Try not to mix.
Nina Savannah
Ranch Hand
Joined: Oct 15, 2008
Posts: 35
posted
0
I set up connection pooling but however I am getting an error:-
The requested resource (/publications/) is not available.
Below is ALL i did to set up connection pooling. Have I ommitted something or is there an error somewhere?
Please make sure you use code tags while posting your code.Unformatted code is difficult to read and results in less response for your post. Read this for more information. You can edit your current post to add code tags by clicking .