I want to use a Datasource to connect to my SQL database so I can use the connection pooling.
So I downloaded the latest version of tomcat installed it and did the following MySQL DBCP Example
http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html
then ran the JSP file http://localhost:8080/DBTest/test.jsp and it worked fine.
Now I need to know exactly what I need to do in my Java app to obtain a datasource.
I tried adding these 2 lines but get this error.
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/DBTest");
need to specify class name in environment.